Keycloak, openId-connect userInfo

Dominik Koszkul picture Dominik Koszkul · Sep 30, 2016 · Viewed 12k times · Source

I'm trying to get info about user roles using openId-connect endpoints of Keycloak. I'm using /auth/realms/moje/protocol/openid-connect/userinfo endpoint to get info about authenticated user. I'm able to get info about name, username, email etc. but I'm not able to force Keyclak to give me info about user roles.

I've read openID documentation and I didn't find any info about got to get roles... I think that there must be a way to find out user roles... Maybe there is another endpoint... I can't find any info...

So finally my question is : Is there any way to get info about user roles using openID connect endpoints ?

Answer

Aman Jaiswal picture Aman Jaiswal · Oct 4, 2016

if you have Client Secret key, then You can get the user role info by passing that secret key.