# Update Identity Provider Attributes... \*especially\* when I'm the IdP (database connection)?

**URL:** <https://community.auth0.com/t/update-identity-provider-attributes-especially-when-im-the-idp-database-connection/150255>\
**Category:** Get Help\
**Tags:** users, management-api\
**Created:** [October 22, 2024, 12:21pm UTC](https://community.auth0.com/t/update-identity-provider-attributes-especially-when-im-the-idp-database-connection/150255 "2024-10-22T12:21:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris.gilroy](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chris.gilroy/32/59858_2.png) [@chris.gilroy](https://community.auth0.com/u/chris.gilroy)\
**Post date:** [October 22, 2024, 12:21pm UTC](https://community.auth0.com/t/update-identity-provider-attributes-especially-when-im-the-idp-database-connection/150255/1 "2024-10-22T12:21:46Z")

</div>

Hi all, I have two connections atm, Azure AD and my local database connection. I can totally get behind not ultimately being able to update IdP attributes like family\_name, given\_name, email and such for any connections that are _not_ my own but is there a way to update them for my database connection?

For example, at my database I have a last\_name and we’ll say it’s ‘DeFino’ for a given user. When that user logs in Auth0 makes the user account and assigns it ‘DeFino’ for the last\_name, however how can I change that? If I change it at my database, it’s never reflected in Auth0, and sending and Auth0 management request (via SDK) also doesn’t change it. I can easily add (and edit) any attribute I assign via user\_metadata or app\_metadata but that’s kinda silly to store everything there _especially_ for fields that could be… duplicates per se.

I am using the PHP (Laravel) SDK if that matters at all.

---

<div class="post-metadata">

**Author:** ![remus.ivan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/remus.ivan/32/68771_2.png) [@remus.ivan](https://community.auth0.com/u/remus.ivan)\
**Post date:** [January 28, 2025, 5:10pm UTC](https://community.auth0.com/t/update-identity-provider-attributes-especially-when-im-the-idp-database-connection/150255/3 "2025-01-28T17:10:35Z")

</div>

Hi @chris.gilroy,

One of the easiest approaches for your use case should be enabling the **Use my Own Database** option from the Auth0 Dashboard, which caches the user’s profile received from your database connection. The cache is stored in the Auth0 database and is refreshed each time the user authenticates. You’ll still have to configure your [Custom Database Action Scripts](https://auth0.com/docs/authenticate/database-connections/custom-db/templates), but you can use the templates that are already listed and just modify them to your needs. This way all user attributes are automatically mapped in the Auth0 database.

The functionality of your custom database can be extended using **Auth0 Actions**. This would also be the most recommended option which works as well for fetching user attributes by using the [Get User Script Templates](https://auth0.com/docs/authenticate/database-connections/custom-db/templates/get-user). More information on how to manage the users’ metadata and best practices can be searched under this [article](https://auth0.com/docs/manage-users/user-accounts/metadata/manage-user-metadata).

Also the user attribute fields can not be duplicates, since they have to follow the [Normalized User Profile Schema](https://auth0.com/docs/manage-users/user-accounts/user-profiles/normalized-user-profile-schema).

You can also use the **Management API** in order to make this changes and you can find more information [here](https://auth0.com/docs/manage-users/user-accounts/user-profiles/configure-connection-sync-with-auth0).

Thank you for posting your inquiry and i hope this helped.  
Best regards,  
Remus

---

<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:** [February 11, 2025, 5:10pm UTC](https://community.auth0.com/t/update-identity-provider-attributes-especially-when-im-the-idp-database-connection/150255/4 "2025-02-11T17:10:44Z")

</div>

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