1

I want to get the groups the user belongs to. I follow this topic: Display content based on group membership - OKTA + ReactJS

I added the scope to the ReactJS Security component, and I added the scope groups to the default Authorization Server in OKTA. After that, following the link instructions, I also had to Create a Groups Claim for Okta-Master groups.

I did all this, no errors, but when I get the user object via auth.getUser() in React, I see the same info as before, no groups.

I know it is possible to manually query groups and group-memberships via the OKTA API, but it would be nice if I could do it this way.

Any ideas?

React Component:

<Security issuer='https://<url>/oauth2/default'
  client_id='<client_id>'
  redirect_uri={window.location.origin + '/implicit/callback'}
  scope={['openid', 'email', 'profile', 'groups']}
  onAuthRequired={onAuthRequired} >

Default Authorization server: enter image description here

Groups claim filter: enter image description here

Eric Jansen
  • 430
  • 1
  • 6
  • 19

1 Answers1

0

Are you requesting id_token and access token together? or are you using authorization code flow with gives id token and access token together? If so, Okta returns "thin token" which only have default values. So you have to send your access token to userinfo. endpoint and get groups.

Sara
  • 212
  • 1
  • 6