Hi,

you added a user and then you authenticated with this user to keycloak application?

The "nothing here" means that whole variable "session" is null or just that name and email are missing in the token? If it's the first case, then I suspect that you didn't authenticate user with the Keycloak at all. Make sure to mark all the security-constraints URLs into web.xml (check the examples for details). If just the name and email is missing in the token, then doublecheck if your user has the values you gave to him (you can do it in admin console). Other possibility is that your client doesn't have protocol mappers, but I don't think error is here as name and email protocol mappers are added by default.

Marek


On 05/10/15 06:19, Mai Zi wrote:
Hi, there

We add a user ( with name and email ) via  the endpoint  :    /admin/realms/demo/users


and then we want to get the name and the email  from the accesstoken, 


KeycloakSecurityContext session = (KeycloakSecurityContext) request.getAttribute(KeycloakSecurityContext.class.getName());
AccessToken token=session.getToken();



but nothing there. 




Can anyone help on this?


T.I.A

Mai






_______________________________________________
keycloak-user mailing list
keycloak-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/keycloak-user