Assign default roles to user using wizard and from rules

Hi team,

I want to assign a default role to user, using user management < user, i want to give “user” role to every person who creates login into that,

I am doing that thing, but when I assign roles using “assign roles” so that thing is not to update app metadata or not in user metadata, so when checking the profile of that user on code, it does not contain that role.

Hi @onlinebookshare and welcome to the Auth0 Community! :cowboy_hat_face:

From what I’ve gathered, you’re using the Authorization Core feature set and have managed to create some Roles under the ‘User Management’ tab in your dashboard and have even assigned those roles to users through the dashboard UI.

Now it sounds like you’re wondering where/how do I access those Roles? If attempting to access a User’s role info (or to assign roles for that matter), a solid place to do that would be in a Rule. Some examples of this can be found here:

https://auth0.com/rules/roles-creation

The above examples show how to assign Roles in your rule or to add Roles info to your tokens. They should also cover the use case I believe you specified regarding setting a default role to a user upon login. As this is a fairly broad answer, I may not have touched upon exactly what your issue is and I do apologize.If you have any specific issues that you need diagnosed we’ll be happy to assist further.

Best Regards,
Colin

2 Likes

Hey there!

As this topic is related to Rules - Hooks - Actions and Rules & Hooks are being deprecated soon I’m excited to let you know about our next Ask me Anything session in the Forum on Thursday, January 18 with the Rules, Hooks and Actions team on Rules & Hooks and why Actions matter! Submit your questions in the thread above and our esteemed product experts will provide written answers on January 18. Find out more about Rules & Hooks and why Actions matter! Can’t wait to see you there!

Learn more here!

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