# Getting group claims for PKCE oauth2 flows

**URL:** <https://devforum.okta.com/t/getting-group-claims-for-pkce-oauth2-flows/9141>\
**Category:** Questions\
**Created:** [April 29, 2020, 10:38am UTC](https://devforum.okta.com/t/getting-group-claims-for-pkce-oauth2-flows/9141 "2020-04-29T10:38:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dusan.plavak](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@dusan.plavak](https://devforum.okta.com/u/dusan.plavak)\
**Post date:** [April 29, 2020, 10:38am UTC](https://devforum.okta.com/t/getting-group-claims-for-pkce-oauth2-flows/9141/1 "2020-04-29T10:38:59Z")

</div>

Hi,

I am using okta-react package and trying to get Group claims in the id\_token.  
When I use implicit flow and specify response type: id\_token then I can see group claims in the id\_token

However if I enable pkce, then response type is forced to the: code and group claims are missing in id\_token…

Is it possible to have group claims in id\_token when using pkce?

---

<div class="post-metadata">

**Author:** ![Ironhide](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/ironhide/32/1799_2.png) [@Ironhide](https://devforum.okta.com/u/Ironhide)\
**Post date:** [April 29, 2020, 11:13am UTC](https://devforum.okta.com/t/getting-group-claims-for-pkce-oauth2-flows/9141/2 "2020-04-29T11:13:15Z")

</div>

PKCE is indeed only supported for the authorization code flow.

A few things to check. Make sure you have a groups claims and that it is included in id tokens  
[https://gyazo.com/d69e5b79bbd3036b8ae2100c457fdcea](https://gyazo.com/d69e5b79bbd3036b8ae2100c457fdcea) security -\> api -\> _click on your authorization server_ -\> claims

Also check your access policies for your authorization server. When I use my token preview it returns the claims for me.  
[https://gyazo.com/989ae4e624c7ad024ce54b7a7b4fc33b](https://gyazo.com/989ae4e624c7ad024ce54b7a7b4fc33b)

In your app you also need to configure a group claim - [https://gyazo.com/e1475ee1af075ec676f2747b449a2640](https://gyazo.com/e1475ee1af075ec676f2747b449a2640)

---

<div class="post-metadata">

**Author:** ![dusan.plavak](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@dusan.plavak](https://devforum.okta.com/u/dusan.plavak)\
**Post date:** [April 29, 2020, 11:35am UTC](https://devforum.okta.com/t/getting-group-claims-for-pkce-oauth2-flows/9141/3 "2020-04-29T11:35:36Z")

</div>

I have group claim configured and it is working when I use implicit flow, the id token shows groups properly.

I do not have Group claims added to auth server - but once again, for implicit flow it is working without it. Preview token does not shows groups because groups are injected by application and not auth server.

---

<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:** [January 23, 2024, 11:27pm UTC](https://devforum.okta.com/t/getting-group-claims-for-pkce-oauth2-flows/9141/4 "2024-01-23T23:27:43Z")

</div>

Closed on January 23, 2024, 11:27pm UTC


