keycloak login page toggle


I have a requirement for a toggle in the login page, between 2 categories

If user chooses category 1, ldap should be used for auth, If user chooses category 2, AD should be used for auth.

Finally to be redirected to the same client application.

Is it possible with keycloak? Does it require development?

Any directions will help.

I don’t find info in keycloak documentation.

Thanks in advance.


This is not supported out of the box, but you can implement a new Authenticator. I imagine you can extend the UsernamePasswordForm. If you traced the code you will find that the current implementation loads the storage providers sorted by priority and tries them one after the other until one succeeds.
Your implementation should override the method “action” and load the ldap // Active directory based on a request parameter.

For more info check

thanks you… I will try out