# Read SAML Response Claims from IdPs inside Actions

**URL:** <https://community.auth0.com/t/read-saml-response-claims-from-idps-inside-actions/88764>\
**Category:** Get Help\
**Tags:** actions, sso, login, saml\
**Created:** [August 15, 2022, 1:29pm UTC](https://community.auth0.com/t/read-saml-response-claims-from-idps-inside-actions/88764 "2022-08-15T13:29:58Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidhouseknechtdev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/davidhouseknechtdev/32/12778_2.png) [@davidhouseknechtdev](https://community.auth0.com/u/davidhouseknechtdev)\
**Post date:** [August 15, 2022, 1:29pm UTC](https://community.auth0.com/t/read-saml-response-claims-from-idps-inside-actions/88764/1 "2022-08-15T13:29:58Z")

</div>

I originally asked a similar question last year ([Cannot Access Mapped SAML properties Inside Custom Action](https://community.auth0.com/t/cannot-access-mapped-saml-properties-inside-custom-action/63615)). The issue still persists so I am still using a custom **Rule** to access the SAML response field.

I would like to migrate over to Actions since those are recommended and Rules are set to be deprecated very soon ([sometime in 2022](https://community.auth0.com/t/how-long-will-you-support-rules/76368)). That response states:

> _First, I’d like to address that we will continue to support Rules until its deprecation sometime in the second half of 2022. By that time, all of the features in Rules will be integrated and available in Actions._

I really want to use **Actions** but this is blocking me. My setup looks like this:

**My Enterprise SAML Mappings**

```json
  "custom_saml_groups": [
	"http://schemas.auth0.com/group"
  ]

```

**My New Action**

```js
exports.onExecutePostLogin = async (event, api) => {
  const customGroups = event.user.custom_saml_groups; // THIS DOES NOT EXIST
  if (customGroups === 'MyExpectedGroup') {
    api.user.setAppMetadata('app_group', 'SpecialGroup');
  }
}

```

Whereas, my current **Rule** still works:

```js
function(user, context, callback) {
  const customGroups =user.custom_saml_groups; // THIS EXISTS
  if (customGroups === 'MyExpectedGroup') {
     const meta = user.app_metadata;
     meta.app_group = 'SpecialGroup';
     auth0.users.updateAppMetadata(user.user_id, meta);
  }
}

```

Another community member [recommended](https://community.auth0.com/t/cannot-access-mapped-saml-properties-inside-custom-action/63615/6) fetching the user from the Management API, but SGO [said that wasn’t a scalable solution](https://community.auth0.com/t/cannot-access-mapped-saml-properties-inside-custom-action/63615/7) because of rate limits.

Is there any update on when this will be available in **Actions** and/or if there is a solution out there? There is no way to map SAML claims to `app_metadata` so my only option is to use Rules/Actions.

Thank you,

David

---

<div class="post-metadata">

**Author:** ![karolis.mazukna](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/karolis.mazukna/32/40957_2.png) [@karolis.mazukna](https://community.auth0.com/u/karolis.mazukna)\
**Post date:** [November 1, 2022, 12:36pm UTC](https://community.auth0.com/t/read-saml-response-claims-from-idps-inside-actions/88764/2 "2022-11-01T12:36:51Z")

</div>

Are there any updates on this issue ?

---

<div class="post-metadata">

**Author:** ![dmitriyrikberg](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dmitriyrikberg/32/49359_2.png) [@dmitriyrikberg](https://community.auth0.com/u/dmitriyrikberg)\
**Post date:** [August 20, 2023, 7:12pm UTC](https://community.auth0.com/t/read-saml-response-claims-from-idps-inside-actions/88764/3 "2023-08-20T19:12:09Z")

</div>

> [@davidhouseknechtdev](#):
>
> The issue still persists so I am still using a custom **Rule** to access the SAML response field.

Could you help me I am looking how to get SAML response with Rule and base on your question looks like you can read saml response but when I pooked in your saml Rule I see its only have access to use metadata but I actually need whole saml response after IDP login

---

<div class="post-metadata">

**Author:** ![davidhouseknechtdev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/davidhouseknechtdev/32/12778_2.png) [@davidhouseknechtdev](https://community.auth0.com/u/davidhouseknechtdev)\
**Post date:** [August 21, 2023, 2:09pm UTC](https://community.auth0.com/t/read-saml-response-claims-from-idps-inside-actions/88764/4 "2023-08-21T14:09:55Z")

</div>

Unfortunately, I don’t have access to the full SAML response in my **Rule**. The `user.custom_saml_groups` you see in my original post comes from my SAML mappings.

 ![image](https://global.discourse-cdn.com/auth0/original/3X/a/f/aff1f3339f78aa7d08745d5e3c50a30b027fb39d.png)

I have to know what kind of SAML claims the customer is sending me in order to add the correct mapping. Once the mapping is added, I have access to the defined field in my **Rule**.

Since I don’t have access to the actual SAML, I needed to communicate with my customer and have them [capture the HAR file](https://helpcenter.coohom.com/en/articles/5882721-how-to-save-a-har-file-log-in-google-chrome) so I could inspect the SAML response that way. Once I had the raw SAML, I could easily add the needed mappings.

---

<div class="post-metadata">

**Author:** ![davidhouseknechtdev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/davidhouseknechtdev/32/12778_2.png) [@davidhouseknechtdev](https://community.auth0.com/u/davidhouseknechtdev)\
**Post date:** [August 21, 2023, 2:13pm UTC](https://community.auth0.com/t/read-saml-response-claims-from-idps-inside-actions/88764/5 "2023-08-21T14:13:52Z")

</div>

For anyone else waiting for this functionality, I reached out to Auth0 support and they informed me they are working on having this feature done late August or early September (2023). They told me to keep an eye on these two resources for updates.

- [Auth0 Changelog](https://auth0.com/changelog)
- [Auth0 Blog](https://auth0.com/blog/)

I will keep an eye on these and post back here once I see something.

---

<div class="post-metadata">

**Author:** ![dmitriyrikberg](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dmitriyrikberg/32/49359_2.png) [@dmitriyrikberg](https://community.auth0.com/u/dmitriyrikberg)\
**Post date:** [August 21, 2023, 2:18pm UTC](https://community.auth0.com/t/read-saml-response-claims-from-idps-inside-actions/88764/6 "2023-08-21T14:18:48Z")

</div>

Thank for your respond. Yes I am trying to figure how to get saml response that I need to pass to external idp maybe with auth0.js or any GET/POST request and so far no luck

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [January 8, 2024, 11:57am UTC](https://community.auth0.com/t/read-saml-response-claims-from-idps-inside-actions/88764/7 "2024-01-08T11:57:52Z")

</div>

Hey there!

As this topic is related to Actions and Rules & Hooks are being deprecated soon in favor of Actions, I’m excited to let you know about our next [Ask me Anything session in the Forum on Thursday, January 18 with the Rules, Hooks and Actions team](https://community.auth0.com/t/auth0-community-ask-me-anything-rules-hooks-and-why-actions-matter/124043) on Rules & Hooks and why Actions matter! Submit your questions in the thread above and our esteemed product experts will provide written answers on January 18. Find out more about Rules & Hooks and why Actions matter! Can’t wait to see you there!

[Learn more here!](https://community.auth0.com/t/auth0-community-ask-me-anything-rules-hooks-and-why-actions-matter/124043)

---

<div class="post-metadata">

**Author:** ![davidhouseknechtdev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/davidhouseknechtdev/32/12778_2.png) [@davidhouseknechtdev](https://community.auth0.com/u/davidhouseknechtdev)\
**Post date:** [January 12, 2024, 2:33pm UTC](https://community.auth0.com/t/read-saml-response-claims-from-idps-inside-actions/88764/8 "2024-01-12T14:33:09Z")

</div>

For posterity, this feature has been implemented in **Actions** now. I made the switch from **Rules** to **Actions** this morning, and our SAML mappings and Action logic are working as expected. Very thankful for all the hard work in getting this in!

---

<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:** [January 26, 2024, 2:33pm UTC](https://community.auth0.com/t/read-saml-response-claims-from-idps-inside-actions/88764/9 "2024-01-26T14:33:41Z")

</div>

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