[keycloak-user] Users assigned to roles

Marek Posolda mposolda at redhat.com
Wed Nov 19 03:39:02 EST 2014


I don't think we have this at this moment. Feel free to create jira, but 
no promise if/when we provide it...

btv. it seems that your query doesn't handle composite roles, but really 
just those roles, which are directly assigned to user in 
user_role_mapping table. I don't know if you care about it... Fact is 
that doing single SQL query including composite roles is probably not 
doable unless you are on Oracle, which allows some kind of hierarchical 
queries afaik.

Marek

On 18.11.2014 18:37, Alarik Myrin wrote:
> I was able to piece together a SQL query:
>
> SELECT u.username, u.first_name, u.last_name, role.name 
> <http://role.name> AS role
>
> FROM keycloak_role role
>
> INNER JOIN realm ON role.realm = realm.id <http://realm.id>
>
> INNER JOIN user_role_mapping rm ON role.id <http://role.id> = rm.role_id
>
> INNER JOIN user_entity u ON rm.user_id = u.id <http://u.id>
>
> WHERE realm.name <http://realm.name>=:1 AND role.name 
> <http://role.name> = :2
>
> It might be nice to do this in the web console though...
>
>
> On Tue, Nov 18, 2014 at 12:28 PM, Alarik Myrin <alarik at zwift.com 
> <mailto:alarik at zwift.com>> wrote:
>
>     Is there any easy way to see which users have been assigned a
>     given role?
>
>
>
>
> _______________________________________________
> keycloak-user mailing list
> 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/20141119/c71e48c6/attachment.html 


More information about the keycloak-user mailing list