Thanks for sharing how to assign a default role with actions for a machine-to-machine application, can you please share the same for a Single Page Application client? Thanks.
Note that the role assigned in the custom action applies to the issued token. This is a very important detail. Otherwise you would need to logout and login again. To have the new permissions of that role in the permissions claim.
Hey, how can I send the role of a user from the frontend? I don't want to assign a default user role, rather I want to set it based on if the user decides to sign up as role A or role B
Hey! Without having all context about your app architecture, one approach could be getting the role in the frontend and then pass it to your backend or API, then your backend can make a call to the Auth0 Management API and assign the role through there. Hope this helps !
Hello! thanks for your comment! Without having much info on your use case I'd that if you need to interact with the Management API (which is the case to assign roles) you need to have an M2M application on Auth0 that connects to your server and those would be the credentials (domain, clientID and clientSecret) that you'd need to use. Hopefully this helps!
Thank you! That worked. btw the code in the video is correct, the one at the blog isn't. the one at the blog should be if ( event.authorization && event.authorization.roles && event.authorization.roles.length > 0 ) { return; }
Considering that hardcoding role ID in action is not what people usually do it would require to pull and filter role by name as well. Also creating separate application for Auth0 actions. Taking into account that everything should be put into some king of scripts to be run by CLI as doing everything by hand from UI is just for demo purposes it seems like too much effort for something that should have come out out of the box
Hi, I need help! How can I integrate Auth0 authentication into the login process and add new fields like "firstname" and "lastname"? I also want to retrieve these names and pass them to the backend using a webhook. Can anyone help me out?
Hi! To integrate Auth0 you can use one of our SDKs depending on the language/framework and application type you have, here's a link to all the SDKs we support: auth0.com/docs/libraries Then, to add new fields in the sign-up process you can use Custom Prompts and customize the sign-up or login pages to fit your needs: auth0.com/docs/customize/login-pages/universal-login/customize-signup-and-login-prompts Hope this helps! -Carla
Glad you like it. It actually takes way less time but you have to put up with my brain dumping and singing skills 😂 wondering if you’d prefer this in like a RU-vid short format? 🤔