[keycloak-user] Login to Keycloak using API and create KeycloakPrincipal object

Mariusz Chruscielewski - Info.nl mariusz at info.nl
Tue Oct 4 09:36:49 EDT 2016


Hi. We are using Keycloak Tomcat Adapter to secure our webapp, after we access protected resource we are redirected to keycloak and after login we go back to our app. After that, we can get KeycloakPrincipal object from web context (request).

Is there a way to create / get this object without using Tomcat Adapter ? We want to make API call (like http://keycloak/auth/realms/vi/protocol/openid-connect/token) and get (or create manually) this object using AccessTokenResponse (or any other object we can get from API).

Ultimate goal is to login to keycloak like adapter does, but directly from Java, without any interaction from user on keycloak forms.

Is it even possible?

Kind Regards,

Mariusz Chruscielewski





More information about the keycloak-user mailing list