# How to extract a claim from a user's Identity Provider Attributes / Raw JSON?

**URL:** <https://community.auth0.com/t/how-to-extract-a-claim-from-a-users-identity-provider-attributes-raw-json/151585>\
**Category:** Get Help\
**Tags:** user-profile, user-management\
**Created:** [November 15, 2024, 9:16am UTC](https://community.auth0.com/t/how-to-extract-a-claim-from-a-users-identity-provider-attributes-raw-json/151585 "2024-11-15T09:16:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![razvan.bigiu](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/razvan.bigiu/32/60772_2.png) [@razvan.bigiu](https://community.auth0.com/u/razvan.bigiu)\
**Post date:** [November 15, 2024, 9:16am UTC](https://community.auth0.com/t/how-to-extract-a-claim-from-a-users-identity-provider-attributes-raw-json/151585/1 "2024-11-15T09:16:37Z")

</div>

I am using a federated identity provider (Azure AD) to send claims to Auth0 during the authentication. One such claim is the Azure AD group(s) the user is included - I was able to set up the mapping in the enterprise connection to receive the groups from Azure AD during the login and they do indeed show up in both User Details → Identity Provider Attributes and the user’s Raw JSON. So far so good.

The problem is when I’m trying to add this particular claim to the user profile. By default, only the standard OIDC claims are included it seems. I’ve tried to use an Action trigger, to inject this claim into the user profile post-login but when I’m browsing the available claims in the Event schema, “groups” are nowhere to be found. How can I extract this claim from Identity Provider Attributes / Raw JSON and pass it to the user profile?

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [November 15, 2024, 11:15am UTC](https://community.auth0.com/t/how-to-extract-a-claim-from-a-users-identity-provider-attributes-raw-json/151585/3 "2024-11-15T11:15:45Z")

</div>

Hi @razvan.bigiu,

Welcome to the Auth0 Community!

Thank you for asking your question, I found this Knowledge Solution that should solve your question → [Extract Azure Custom Claim from ID Token and copy it to User Metadata in Auth0](https://community.auth0.com/t/extract-azure-custom-claim-from-id-token-and-copy-it-to-user-metadata-in-auth0/122965/1)

Thanks  
Dawid

---

<div class="post-metadata">

**Author:** ![razvan.bigiu](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/razvan.bigiu/32/60772_2.png) [@razvan.bigiu](https://community.auth0.com/u/razvan.bigiu)\
**Post date:** [November 15, 2024, 12:55pm UTC](https://community.auth0.com/t/how-to-extract-a-claim-from-a-users-identity-provider-attributes-raw-json/151585/4 "2024-11-15T12:55:12Z")

</div>

Hi Dawid!

Thank you for your quick response. I’ve already set up a SAML connection to Azure AD and mapped the “groups” claim. Like I mentioned, this claim is successfully retrieved from Azure AD during login and added to the user’s Raw JSON.

 ![image](https://global.discourse-cdn.com/auth0/original/3X/8/0/8069fd3340e3b4eeec162576ecfdcd05cadde24b.png)  
 ![image](https://global.discourse-cdn.com/auth0/original/3X/4/8/4886cf2f35be8064f8433118f6faa6f16993d202.png)

I’m not entirely sure if this also means that the claim is added to the user profile “at the root level”, as the article you provided puts it. If not, how can this be accomplished?

Right now, if I go to Actions and explore all the claims available in the Event schema, I can’t find “groups” anywhere, even though it is available in the Raw JSON. Trying to access it through event.user doesn’t work because it’s apparently not recognized.

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [November 15, 2024, 10:21pm UTC](https://community.auth0.com/t/how-to-extract-a-claim-from-a-users-identity-provider-attributes-raw-json/151585/5 "2024-11-15T22:21:48Z")

</div>

Hi @razvan.bigiu,

Yes, the groups are added at your user root level. If you want to access them in the Actions you can use the `event.user.groups`, it’s not yet documented in the actions documentation, and will be updated soon.

Thanks  
Dawid

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [November 29, 2024, 10:22pm UTC](https://community.auth0.com/t/how-to-extract-a-claim-from-a-users-identity-provider-attributes-raw-json/151585/6 "2024-11-29T22:22:15Z")

</div>

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