UserInfo not returning groups

Unable to retrieve group information on my userinfo call. I’ve read all the pertinent community messages in this forum and verified all recommendations, but to no avail.

I have a group created and one user assigned to it:

I have one application and assigned it to the group:

I have configured the OpenID Connect ID Token for the app:

I’m using the Default Authorization Server with the following Claims:


The Token Preview shows:

Interestingly, though, if I specify openid and profile on the scope, I do not get the groups:

I retrieve the Access Token using the authorize URL:

https://dev-14409172.okta.com/oauth2/default/v1/authorize?
With parameters:

response_type=code
client_id=0oan3lzmskgMUmotO5d7
redirect_uri=http://127.0.0.0/
scope=openid+profile+groups
state=12345"

I then take the access code and get an access token using the tokeninfo enpoint and then specify the resulting token in the userinfo call:

And no groups are returned.

Please advise what I’m doing wrong.

Thanks in advance.

It looks like the groups claim you configured on your custom authorization server is set to be included int he Access Token ('Include in token type"). That would explain why you are not seeing it when you preview tokens with the openid scope, because the payload you are looking at is for the id_token, not the access token. If you switch the the tab labelled ‘token’, do you see your claim once more?

If you want the claim to appear at the userinfo endpoint, change the “Include in token type” option to ID Token.

PS, that right now you do not need to request that groups scope NOR the settings on the Application → Sign On tag. When using a custom AS (like Default) to get tokens, then you only need to configure the claim at the authorization server level, not at the application level. As for the groups scope, this is only required when using the Org Authorization Server (which is when those settings on the Applcation → Sign On tab come into play). The groups claim you created is currently set to be included for Any scope, so if you do want to use the groups scope you created so that its only included when requested, you would need to set the “Include in” option to the groups scope.

More info about groups claims can be found here; Customize tokens returned from Okta with a groups claim | Okta Developer

Ah…I had missed the Token Type tab. Yes it shows there!

And changing it to “Include in token type” fixed the userinfo end point to!

Thanks so much! I’ve only been banging my head for a couple of days on this!!!

1 Like

no problem! glad you were able to get it working.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.