I am using Keycloak to secure my web application which is a war deployed on Tomcat. My application redirects to Keycloak login and on successful login,the user is redirected to my home page. The requirement is to redirect the user to different pages based on the user role(admin, user). Can anyone tell me how to achieve this. I have tried adding different redirect Uris in the client on keycloak console. I also added in web.xml file but it does not work. I keep getting error msg about too many redirects.
I could do this by having a default web page to redirect from Keycloak. Then,in the default page, I call a method in the backing bean to check the user and redirect accordingly. This method is called on loading the default page.The default page never has a user interface, it just calls the method on event . This is what I have in my default page below. <f:event type="preRenderView" listener="#{bean.roleRedirect}"