<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 3, 2015 at 10:34 AM, Naif <span dir="ltr">&lt;<a href="mailto:nifs.arpegiuz@gmail.com" target="_blank">nifs.arpegiuz@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi everyone<br>
<br>
I checked the aerogear android cookbook, and i found the &#39;ShootAndShare&#39;<br>
demo, it has interesting code in the &#39;KeycloakHelper.java&#39; with some utility<br>
methods. But, i would like to know, how can i get the roles for a registered<br>
keycloak user?<br>
<br>
Are the AuthorizationManager and AuthzModule the right classes for this<br>
task? Or, it is better to use another approach? Because, it would be<br>
necessary to retrieve more user information from Keycloak(i.e. user email,<br>
first name, etc) and to code a correct logout method.<br>
<br>
Any ideas?<br></blockquote><div><br></div><div>The authz librares are mostly used to managing OAuth2 tokens and lifecycles.  One could modify the classes in the oauth2 package to handle keycloak events.  I would begin looking at Oauth2Session and Oauth2AuthzService.  The session class would add properties available from KeyCloak and the OAuth2AuthzService class would fetch these properties as part of the login lifecycle.  Everything else would probably remain relatively untouched.</div><div><br></div><div>This sounds like an amazing opportunity for some refactoring or adding pluggability to the lifecycle.</div><div><br></div><div>TL;DR; yes those are good interfaces to look at.</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks in advance.<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://aerogear-users.1116366.n5.nabble.com/Android-How-can-i-get-user-s-roles-from-Keycloak-OAuth2-Endpoint-tp230.html" rel="noreferrer" target="_blank">http://aerogear-users.1116366.n5.nabble.com/Android-How-can-i-get-user-s-roles-from-Keycloak-OAuth2-Endpoint-tp230.html</a><br>
Sent from the aerogear-users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Aerogear-users mailing list<br>
<a href="mailto:Aerogear-users@lists.jboss.org">Aerogear-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-users" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-users</a><br>
</blockquote></div><br></div></div>