It appears that you may be using the wrong token. When initializing auth0.Management, you should be using the id token you get from the login. As stated in the documentation, it provides an API Client for the Auth0 Management API (only methods meant to be used from the client with the user token). So first you’d have something like:
Thanks for the input.
I think my problem was that I started working with auth0.js version 9 (where it is the access token to be used and where I used a different initial audience and then tried using checkSession to get a token for another audience). After reverting back to version 8 and making sure to request the right scopes from the management api audience it is working.
I guess that i am not able to make requests on the management API because my WebAuth config audience is pointing to /userinfo. But when I change to /api/v2/, it turns impossible to login.
I have already tried with both idToken and accessToken, the error responses are the following: