# Access token for machine-to-machine API

**URL:** <https://community.auth0.com/t/access-token-for-machine-to-machine-api/95256>\
**Category:** Get Help\
**Tags:** users, management-api\
**Created:** [November 28, 2022, 10:40pm UTC](https://community.auth0.com/t/access-token-for-machine-to-machine-api/95256 "2022-11-28T22:40:50Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [November 29, 2022, 10:25pm UTC](https://community.auth0.com/t/access-token-for-machine-to-machine-api/95256/7 "2022-11-29T22:25:19Z")

</div>

Thanks for following up @tms!

> [@tms](#):
>
> I have a backend API. I already have an Application of type SPA. When I use the client\_id and client\_secret of that SPA Application, I get a 403 complaint in response to the token request.

It is not recommended that SPAs request management API tokens for reasons outlined [here](https://auth0.com/docs/secure/tokens/access-tokens/get-management-api-tokens-for-single-page-applications#limitations). The M2M approach essentially allows your backend to proxy requests on behalf of your SPA, keeping the client id and secret safe. This use case is outline here:

[https://community.auth0.com/t/how-can-i-enable-users-to-change-their-email-address-from-a-spa-or-native-app/44064](https://community.auth0.com/t/how-can-i-enable-users-to-change-their-email-address-from-a-spa-or-native-app/44064)

> [@tms](#):
>
> I therefore gather that each API I create (I have two so far) requires a Machine-To-Machine Application instance, and I then need an additional SPA Application for each front-end that I use.

You should be able to utilize a single M2M app and authorize it for multiple APIs.

> [@Best practice to set up one m2m app and multiple APIs](https://community.auth0.com/t/best-practice-to-set-up-one-m2m-app-and-multiple-apis/73135/3):
>
> Hi @domasr, Welcome to the Auth0 Community! Generally, you would have one application. The application requests tokens from the auth server and uses the tokens to request resources from the API. I don’t see the benefit of multiple M2M applications in this scenario, but I would be happy to explore further if you provide more detail.

---

_[View the full topic](https://community.auth0.com/t/access-token-for-machine-to-machine-api/95256)._
