Hii…In my application there is a field called roles in which the user specify his roles as(Doctor,pharmacist or patient),I created a additional custom signup field in auth0 and now user_metadata of the user is updated with the roles he specifies in UI. Also I created a new authorization extension in which I created Roles and certain permissions are added to it (eg:update:discharge for Doctor).Now my question are as follows
- how to assign the roles in authorization-extension based on the user_metadata of the user ?
2)how does the permissions under specific roles should be populated and updated in app_metadata of the user
Note:Everything is working fine when I do it manually like, when a user registers I’m going into authorization extension and adding roles to that user,so after logging in once the app_metadata is updated with roles and permissions.
So how to do it automatically,once the user login, based on the roles he specified in UI,it should equate it with authorization extension roles and the permission along with it should be updated in app_metadata of the user.
Any help is appreciated. Thanks!