# Can't use management API endpoints with login Access Token

**URL:** <https://community.auth0.com/t/cant-use-management-api-endpoints-with-login-access-token/107599>\
**Category:** Get Help\
**Tags:** sdks-quickstarts, auth0-react\
**Created:** [May 23, 2023, 8:54am UTC](https://community.auth0.com/t/cant-use-management-api-endpoints-with-login-access-token/107599 "2023-05-23T08:54:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![goncalo.rodrigues](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/goncalo.rodrigues/32/33548_2.png) [@goncalo.rodrigues](https://community.auth0.com/u/goncalo.rodrigues)\
**Post date:** [May 23, 2023, 8:54am UTC](https://community.auth0.com/t/cant-use-management-api-endpoints-with-login-access-token/107599/1 "2023-05-23T08:54:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nemanja.milojevic](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@nemanja.milojevic](https://community.auth0.com/u/nemanja.milojevic)\
**Post date:** [May 23, 2023, 9:44am UTC](https://community.auth0.com/t/cant-use-management-api-endpoints-with-login-access-token/107599/2 "2023-05-23T09:44:08Z")

</div>

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](https://auth0.com/docs/secure/tokens/access-tokens/management-api-access-tokens)

Hope this helps

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [May 23, 2023, 9:49am UTC](https://community.auth0.com/t/cant-use-management-api-endpoints-with-login-access-token/107599/3 "2023-05-23T09:49:11Z")

</div>

Teamwork makes the dream work!

---

<div class="post-metadata">

**Author:** ![goncalo.rodrigues](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/goncalo.rodrigues/32/33548_2.png) [@goncalo.rodrigues](https://community.auth0.com/u/goncalo.rodrigues)\
**Post date:** [May 23, 2023, 10:17am UTC](https://community.auth0.com/t/cant-use-management-api-endpoints-with-login-access-token/107599/4 "2023-05-23T10:17:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nemanja.milojevic](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@nemanja.milojevic](https://community.auth0.com/u/nemanja.milojevic)\
**Post date:** [May 23, 2023, 10:30am UTC](https://community.auth0.com/t/cant-use-management-api-endpoints-with-login-access-token/107599/5 "2023-05-23T10:30:52Z")

</div>

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](https://auth0.com/docs/secure/tokens/access-tokens/get-management-api-tokens-for-single-page-applications)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [June 6, 2023, 10:31am UTC](https://community.auth0.com/t/cant-use-management-api-endpoints-with-login-access-token/107599/6 "2023-06-06T10:31:02Z")

</div>

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