# Accessing the Management API Without Client Credentials Grant Type

**URL:** <https://community.auth0.com/t/accessing-the-management-api-without-client-credentials-grant-type/63379>\
**Category:** Get Help\
**Tags:** api, management-api, auth0\
**Created:** [May 26, 2021, 12:15am UTC](https://community.auth0.com/t/accessing-the-management-api-without-client-credentials-grant-type/63379 "2021-05-26T00:15:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris30](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chris30/32/12821_2.png) [@chris30](https://community.auth0.com/u/chris30)\
**Post date:** [May 26, 2021, 12:15am UTC](https://community.auth0.com/t/accessing-the-management-api-without-client-credentials-grant-type/63379/1 "2021-05-26T00:15:49Z")

</div>

I have a React app that uses a Node.js server. I am attempting to change a user’s username using the Management API. I know that Management API tokens requested by SPAs have certain limitations because they cannot sensitively store data and only certain scopes can be accessed. Therefore, it is my understanding that I must request a Management API token from the Node.js server in order to update a user’s username.

I enabled the Client Credentials Grant Type for my app in order to automatically obtain a Management API token using the [ManagementClient](https://github.com/auth0/node-auth0). But the only way to enable the Client Credentials Grant Type was to change my app type from an SPA to a regular web app. After I made the change the login and logout functionality of my app stopped working. Is there a way to request an access token for the Management API from a Node.js server without enabling the Client Credentials grant type? I also attempted to access the _/oauth/token_ [endpoint](https://auth0.com/docs/tokens/management-api-access-tokens/get-management-api-access-tokens-for-production) to get a Management API token, but that also seems to require Client Credentials to be enabled.

I have been following the steps laid out in the this forum [post](https://community.auth0.com/t/how-can-i-enable-users-to-change-their-email-address-from-a-spa-or-native-app/44064), however, I do not understand how to get the Management API token if it is not generated automatically by the ManagementClient using the Client Credentials Grant Type.

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [May 26, 2021, 12:23pm UTC](https://community.auth0.com/t/accessing-the-management-api-without-client-credentials-grant-type/63379/3 "2021-05-26T12:23:19Z")

</div>

Hi @chris30,

Welcome to the Community!

> [@chris30](#):
>
> But the only way to enable the Client Credentials Grant Type was to change my app type from an SPA to a regular web app.

Instead of changing the app type of the SPA application, you will want to create a new machine-to-machine application for your Node.js API. The settings in the SPA application should stay the same.

> **[Register Machine-to-Machine Applications](https://auth0.com/docs/get-started/auth0-overview/create-applications/machine-to-machine-apps)**
>
> Learn how to register and configure a machine-to-machine (M2M) application using the Auth0 Dashboard and authorize it using the Management API test feature.

---

<div class="post-metadata">

**Author:** ![chris30](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chris30/32/12821_2.png) [@chris30](https://community.auth0.com/u/chris30)\
**Post date:** [May 26, 2021, 4:48pm UTC](https://community.auth0.com/t/accessing-the-management-api-without-client-credentials-grant-type/63379/4 "2021-05-26T16:48:33Z")

</div>

Hello, thanks for the clear response. I did just need to create a new Machine-to-Machine application for my Node.js server and I was able to use the ManagementClient to automatically request an API token for the Management API.

---

<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 10, 2021, 4:48pm UTC](https://community.auth0.com/t/accessing-the-management-api-without-client-credentials-grant-type/63379/5 "2021-06-10T16:48:41Z")

</div>

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