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} >