Dennis,
Add a Security Config class. Then auto wire your accessToken where needed.
@Configuration
public class SecurityConfig {
@Bean
@Scope(scopeName = WebApplicationContext.SCOPE_REQUEST, proxyMode =
ScopedProxyMode.TARGET_CLASS)
public AccessToken getAccessToken() {
HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.currentRequestAttributes()).getRequest();
return ((KeycloakPrincipal)
request.getUserPrincipal()).getKeycloakSecurityContext().getToken();
}
}
-dana
On Jul 14, 2017, at 9:27 AM, Dennis H
<dennishonders@gmail.com<mailto:dennishonders@gmail.com>> wrote:
Does the keycloak java spring boot library provide a service, that contains
the user info, which can be injected in a class?
If not, how to retrieve the user info from the request?
I can't find this in the docs.
_______________________________________________
keycloak-user mailing list
keycloak-user@lists.jboss.org<mailto:keycloak-user@lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/keycloak-user