Can't use management API endpoints with login Access Token

Hi,

I am currently working with react auth0 sdk and im struggling a bit. Im logging in with a user and sending the token to the backend that will create a ticket to reset password but it gives me error saying “Bad Token, Invalid JSON”.

I am using the audience of the default API of auth0 for the login and it still doesn’t work.
Why is this happening?

Thanks for your help in advance.

You can’t use the access token you acquired after login for management API. You need to authorize your app with the management API, and by doing that you will get a new access token used only for this API. You can find more info here: Management API Access Tokens

Hope this helps

1 Like

Teamwork makes the dream work!

1 Like

But should i get the access token using the react auth0 sdk or through the backend?

It’s recommended you do this on the backend using client_credentials flow. You should be able to do this on the frontend also, but the resulting token will be limited since front channel apps are not as secure: Get Management API Access Tokens for Single-Page Applications

2 Likes

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