Auth0 v9 get user roles and permissions

I am trying to get the permissions and roles associated with a specific user and for some reason Auth0 does not include those in the token. Could anyone help with what I may be doing wrong?
here is how I instantiate auth0; PS: I am using Auth0.js v9 Reference

const webAuth = new auth0.WebAuth({
  domain: process.env.REACT_APP_AUTH0_DOMAIN || '',
  clientID: process.env.REACT_APP_AUTH0_CLIENT_ID || '',
  responseType: 'token id_token',
  scope: 'openid profile email roles',
  audience: 'ternwheel',
  redirectUri: window.location.origin,

Here is how I call the auth with password and an email

        realm: 'Username-Password-Authentication',
        responseType: 'token id_token',
        redirectUri: window.location.origin,
      e => console.log(e)

finally auth0 sends me this token that does not include the permissions or roles

I have also turned on RBAC for my api.

Hi @riunge,

Welcome to the Auth0 Community!

I understand you would like to add roles and permissions to the access token.

The token you posted appears to include some permissions, that is good. Is there some missing from that array?

Screenshot 2023-04-06 at 4.11.10 PM

As for adding the roles to the token. That can be done in an Action. Here is an FAQ on the subject:

Let me know if you have any questions!

1 Like

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