This tutorial will help you call your API from a machine-to-machine (M2M) application using the Client Credentials Flow. To learn how the flow works and why you should use it, read Client Credentials Flow.
Prerequisites
Before beginning this tutorial:- Register your API with Auth0
-
Register the M2M Application with Auth0.
- Select an Application Type of Machine to Machine Applications.
- Choose your previously-registered API.
- Authorize the M2M Application to call your API.
Steps
- Request tokens: From the authorized application, request an access token for your API.
- Call API: Use the retrieved access token to call your API.
Request tokens
To access your API, you must request an access token for it. To do so, you will need toPOST to the token URL.
Example POST to token URL
Parameters
Response
If all goes well, you’ll receive anHTTP 200 response with a payload containing access_token, token_type, and expires_in values: