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

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.

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, 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. More information on how to manage the users’ metadata and best practices can be searched under this article.

Also the user attribute fields can not be duplicates, since they have to follow the Normalized User Profile Schema.

You can also use the Management API in order to make this changes and you can find more information here.

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