I have a NodeJS/Express backend. I’m building a React SPA which creates groups of users with a single group admin. If a new user creates their own group, then I mark them as an admin in my own user DB. I also want to leverage an Auth0 role to control permissions. I have a structure for this in both front and backends which works - but I currently manage role assignment only through the console. What I want instead is to include code in my backend that communicates with the Auth0 mgmt api during the New Group process and assigns the admin role to the user in question.
But it’s still not clear to me how to actually use this in my backend operationally. All I need if a single working Github example of mgmt API use in a NodeJS and I can probably figure it out - but I can’t find any working examples anywhere. Does anyone know of an example I can reference to see Node JS mgmt API communication in action, most especially an example which updates user or app metadata?
Thanks for the quick reply Reuben! I saw that example. The problem is that I have no idea how to actually use this in practice. If there were even a single working sample app that used this operationally, I could look at the sample app and figure it out. Does Auth0 have a sample app that uses this anywhere?
Thanks for the links Rueben. Unfortunately, none of that helps in this case as I do not see any examples of updating metadata via Auth0 mgmt api from the backend. I will keep digging through documentation and examples to see if I can find something.
You should be able to embed the code snippet I shared in my initial post into your backend code to make a call to the Management API to update the user’s user_metadata.
Were you having any issues getting that implemented?