Hello Aritz,
couldn't you just use a JWT parser library to parse the AccessToken string?http://jwt.io/ lists quite a few usable ones:
I created a gist with a quick example for parsing a keycloak AccessToken with jjwt:
To get the roles for a particular application (acme-petclinic) in this case, you could do the following:((Map<String,Object)((Map<String,Object>)claimsJws.getBody().get("resource_access")).get("acme-petclinic")).get("roles")
Cheers,Thomas
2016-03-07 15:53 GMT+01:00 Aritz Maeztu <amaeztu@tesicnor.com>:
Hi all,
I'm managing the keycloak authentication-authorization for my Android app. I do it manually since there's no adapter still available as far as I know. Currently I am able to log in from a webview, retrieve the access token using the code and refresh the token when it's necessary and retrieve the user info using the openid-connect compliant endpoints. However, I would like to grab the roles available for the token too, in order to show/hide specific operations in the screen.
How to achieve it?
Thanks in advance.
_______________________________________________
keycloak-user mailing list
keycloak-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/keycloak-user