Auth0 user profile

Is it possible to store user’s address and phone_number in auth0 user profile as the response shows that we can fetch address and phone_number from the user’s profile User Profiles. however the create user api in management api doesn’t accpet address and phone_number in the body of the request.

Thanks in advance

2 Likes

Hello! Welcome to our Community!

You might have read the oidc user profile doc (the one you have mentioned) that indeed has phone_number and address.

The Auth0 user profile is explained in the following url: Normalized User Profiles

It allows phone_number but there is no address string. That might be the reason the Management API does not allow you to make the request.

Thank you!

Thank you! But then how does one update the OIDC profile fields?

1 Like

Thank you Karen, but how does one update the OIDC fields? I need to add address and phone number fields. @karen.bermudez

Hi,

Concerning the claims that can be added to an OpenId token such as user’s address and phone_number in your case, the rule of thumb is to put them within the user_metadata section or the app_metadata.
The reason is that these “additional” claims are considered as custom claims and these ones can collide with the existing default claims which are at the root level.
Maybe your error is coming from the fact that the set of default existing claims cannot be extended.

What I’m doing about the claims I want to add to an OpenID token is to put them in:

  • user_metadata for the claims which can be modified by the user such as phone number, preferred social media, etc.
  • app_metadata for the claims which cannot be modified by the user such as the user group and so on.

You should give a try to this solution to see if this one suits your needs.

Best regards.

1 Like

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