[keycloak-user] Get user's roles from groups using POST

Eric Matte eric.matte at bionxinternational.com
Fri Sep 9 11:33:35 EDT 2016


What is specifically that GET request?
Is there a way to just confirm user authentication on the backend with a POST/GET method?

Something that would return the parsed token of the user for his current session.
With the parsed token, the backend server could validate the user, but could also get directly all of the user’s roles.

Eric

From: Thomas Darimont [mailto:thomas.darimont at googlemail.com]
Sent: September 9, 2016 3:37 AM
To: Marek Posolda <mposolda at redhat.com>
Cc: Eric Matte <eric.matte at bionxinternational.com>; keycloak-user at lists.jboss.org
Subject: Re: [keycloak-user] Get user's roles from groups using POST

Hello,

with the changes from this PR: https://github.com/keycloak/keycloak/pull/3120
the realm roles and client roles would also be available with a single GET request.

Cheers,
Thomas

2016-09-09 9:21 GMT+02:00 Marek Posolda <mposolda at redhat.com<mailto:mposolda at redhat.com>>:
Yep. You can take a look at our testsuite for inspiration : https://github.com/keycloak/keycloak/blob/master/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/UserTest.java .

Especially see last test "roleMappings"

Marek


On 08/09/16 20:30, Eric Matte wrote:
Hi, I need to get all user roles from a specified user ID from all assigned groups for this particular user.
I have searched into the API documentation and found no link that could returns me all roles of the authenticated user.

Currently, I have the user id, the realm name, the client id, and an admin token.
I need to send a POST method from my backend in order for it the properly set all the session’s variables.

http://www.keycloak.org/docs/rest-api/#_userrepresentation<http://www.keycloak.org/docs/rest-api/%23_userrepresentation>
From this link, UserRepresentation seems to have everything I need, but while checking the code on GitHub, the function for “GET /admin/realms/{realm}/users/{id}” only returns the few first variables (name, email, id, etc.). But, clientRoles, for instance, is not returned.

Thank you


_______________________________________________

keycloak-user mailing list

keycloak-user at lists.jboss.org<mailto:keycloak-user at lists.jboss.org>

https://lists.jboss.org/mailman/listinfo/keycloak-user



_______________________________________________
keycloak-user mailing list
keycloak-user at lists.jboss.org<mailto:keycloak-user at lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/keycloak-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20160909/07520c88/attachment-0001.html 


More information about the keycloak-user mailing list