Auth0 Home Blog Docs

Vue authentication custom fields



Hi all!

I’m struggling with the roles still.

I use the Vue tutorial for the single page apps the only part that looks like a request is:

auth0 = new auth0.WebAuth({
    domain: '__AUTH0_NAMESPACE__',
    clientID: '__AUTH0_CLIENT_ID__',
    redirectUri: 'http://localhost:3000/callback',
    audience: 'https://__AUTH0_NAMESPACE__/userinfo',
    responseType: 'token id_token',
    scope: 'openid',
    roles: 'admin

So I’ve added the " roles: ‘admin’ " to the end of it, that doesn’t work.

Where and how can I add custom fields when I authorising the user using Vue single page app?


depending on how you want to add roles to users you can use a Rule to accomplish this, here is an example:


Thank you, that example works well.

The point is I want to make rule depends on a custom parameter sent with the authorization request.