# Getting Groups in React App

**URL:** <https://devforum.okta.com/t/getting-groups-in-react-app/3887>\
**Category:** Questions\
**Created:** [January 14, 2019, 3:12pm UTC](https://devforum.okta.com/t/getting-groups-in-react-app/3887 "2019-01-14T15:12:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![joe.mcmahon](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@joe.mcmahon](https://devforum.okta.com/u/joe.mcmahon)\
**Post date:** [January 14, 2019, 3:12pm UTC](https://devforum.okta.com/t/getting-groups-in-react-app/3887/1 "2019-01-14T15:12:43Z")

</div>

I followed the React Simple app example and I can authenticate users using the Okta Preview app I configured. However, I want to access Groups. The docs say that I can configure it on the App page -\> Sign On tab -\> Groups claim. But I only see Token Credentials and SignOn Policy on that page.

Any ideas?

---

<div class="post-metadata">

**Author:** ![mike.desillier](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mike.desillier](https://devforum.okta.com/u/mike.desillier)\
**Post date:** [January 14, 2019, 3:36pm UTC](https://devforum.okta.com/t/getting-groups-in-react-app/3887/2 "2019-01-14T15:36:09Z")

</div>

Hi Joe,

Did you add the claim to the access token? This can be achieved by going API -\> Authorization Server -\> and selecting the default server. Within that menu, you have the ability to configure the claim’s within that Access Token and access the groups assigned to that user.

Let me know if that works for you.

Best,

Mike

---

<div class="post-metadata">

**Author:** ![joe.mcmahon](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@joe.mcmahon](https://devforum.okta.com/u/joe.mcmahon)\
**Post date:** [January 14, 2019, 5:24pm UTC](https://devforum.okta.com/t/getting-groups-in-react-app/3887/3 "2019-01-14T17:24:49Z")

</div>

Thanks - I added it so now I have a “groups” scope and I added the claim that matches on regex .\*

When I use the Token Preview, I can see the groups in the payload:

> “groups”: [  
> “Everyone”,  
> “Admins”  
> ]

But I’m not see in it in the React JS code. I make a call to:

> this.props.auth.getUser()

and the resulting user object doesn’t have the groups. My scope in the Security block is set to:

> scope={[‘openid’,‘email’,‘profile’,‘groups’]}

---

<div class="post-metadata">

**Author:** ![subs](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/subs/32/2991_2.png) [@subs](https://devforum.okta.com/u/subs)\
**Post date:** [May 24, 2021, 2:54pm UTC](https://devforum.okta.com/t/getting-groups-in-react-app/3887/4 "2021-05-24T14:54:14Z")

</div>

Did you ever figure this out?

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 8, 2024, 6:15pm UTC](https://devforum.okta.com/t/getting-groups-in-react-app/3887/5 "2024-02-08T18:15:27Z")

</div>


