# Custom Attributes in Identity Provider

**URL:** <https://forum.inductiveautomation.com/t/custom-attributes-in-identity-provider/58198>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [April 7, 2022, 11:57pm UTC](https://forum.inductiveautomation.com/t/custom-attributes-in-identity-provider/58198 "2022-04-07T23:57:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [April 7, 2022, 11:57pm UTC](https://forum.inductiveautomation.com/t/custom-attributes-in-identity-provider/58198/1 "2022-04-07T23:57:25Z")

</div>

Is there any way to add arbitrary custom attributes (eg. phoneNumber) to a SAML identity provider?

This post seems to only cover OIDC providers and I can't find anywhere the question has been asked about SAML.

> [@Custom attributes for Identity Providers](https://forum.inductiveautomation.com/t/custom-attributes-for-identity-providers/35891):
>
> Is there any way to add custom attributes to the identity provider setup? There are some user metadata held in our idp that I would like to have as session properties in perspective. Thanks!

---

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [April 18, 2022, 2:35pm UTC](https://forum.inductiveautomation.com/t/custom-attributes-in-identity-provider/58198/2 "2022-04-18T14:35:49Z")

</div>

Does anyone know if this is possible?

---

<div class="post-metadata">

**Author:** ![jspecht](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jspecht/32/6465_2.png) [@jspecht](https://forum.inductiveautomation.com/u/jspecht)\
**Post date:** [April 18, 2022, 2:59pm UTC](https://forum.inductiveautomation.com/t/custom-attributes-in-identity-provider/58198/3 "2022-04-18T14:59:43Z")

</div>

No, this is not currently possible with the SAML IdP.

Does your IdP expose any REST API that you could call from a perspective session script? If you could pass along the username of the user currently logged in via SAML, and the REST API could return extra information about the user, you could add the user’s phone number to session props after logging in.

Another workaround: you could use a runScript expression function in one of your user attribute mappers to load the phone number from the SAMLResponse assertion and store it somewhere in ignition, perhaps as a user in an internal user source? In your perspective session, you can write a script to load the user from this special user source sharing the same username as the SAML username and pull the phone number from the internal user.

---

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [April 18, 2022, 3:31pm UTC](https://forum.inductiveautomation.com/t/custom-attributes-in-identity-provider/58198/4 "2022-04-18T15:31:27Z")

</div>

I’ll have to look into the REST API option. Thanks for the suggestions.
