Move user metadata attributes to profile root attributes
What does it do?
This rule moves select data from usermetadata to profile root attributes (familyname, givenname, name, nickname and picture). Verify the field mapping before enabling this rule. The rule will determine if there is a mapped field on the usermetadata before the update. Important:
1- The rule updates the profile root attribute with the mapped field from usermetadata. 2- The mapped fields from usermetadata will be removed following the update. 3- This rule will be executed on each login event. For signup scenarios, you should only consider using this rule if you currently use a custom signup form or Authentication Signup API, as these signup methods do not support setting the root attributes.
How do I use it?
Just create a new rule in the Auth0 dashboard, and copy the following code replacing the placeholders with the appropriate values.
What is Rule-Based Authentication?
Rules can be used to enrich and transform the user profile, deny access to specific users under certain conditions, retrieve information from external services and much more. For more information about rules, please check the documentation