0

I have got a accessToken by calling the keycloak endpoint /token using REST Api as follows

curl -d 'client_id=myclient' -d 'username=username' -d 'password=password' -d 'grant_type=password' -d 'scope=openid' -d 'client_secret=xxxxxxxxxxxxxxxxxxxxxxxxx' 'http://192.168.43.29:8080/realms/aurcc/protocol/openid-connect/token'

But by using this api, when a request is made to the /userinfo endpoint, response will only contains sub,given_name,preferred_name,email_verified,family_name. But the response doesn't contain any information about the groups in which the user is added.

Next time, I used keycloak-js adapter in my Vuejs application. There the /userinfo endpoint results in a response which contains the above said attributes plus the groups attribute. I don't why this weird thing happening.

Help me to get the groups attribute in the response of /userinfo endpoint.

Ragul R
  • 1
  • 1
  • In the access token did not include groups information. so `/userinfo` did not include groups information. Only `GET /{realm}/users/{user-id}/groups` can get the user's group information. And can you shows `keycloak-js` adapter include groups information? I think that is not correct information. – Bench Vue Feb 14 '23 at 02:19
  • 1
    I solved the problem by adding `groups` mapper in the clients scope section. Anyway thanks for your answer. – Ragul R Feb 15 '23 at 02:19

0 Answers0