I'm testing a javaee webapp inside a Wildfly with a 4.5.0.Final keycloak adapter
installed. The authentication is ok but now I would get in my web app the current user
id.
Using this code:
javax.security.jacc.PolicyContext.getContext("javax.security.auth.Subject.container");
I get null. How I miss to receive the user id?
You can test the sample of the keycloak quickstart from
https://github.com/keycloak/keycloak-quickstarts/tree/latest/app-authz-je... and add
that code in the Controller class where do you want.