Parameter Name | Description |
---|---|
grant_type | Set this to “client_credentials”. |
client_id | Your application’s Client ID. You can find this value on the application’s settings tab. |
client_secret | Your application’s Client Secret. You can find this value on the application’s settings tab. To learn more about available application authentication methods, read Application Credentials. |
audience | The audience for the token, which is your API. You can find this in the Identifier field on your API’s settings tab. |
organization | Optional. The organization name or identifier you want the request to be associated with. To learn more, read Machine-to-Machine Access for Organizations. |
HTTP 200
response with a payload containing access_token
, token_type
, and expires_in
values:
/authorize
endpoint to request access. This access is both requested by the application and granted by the user during authentication
You can configure your tenant to always include a default audience.
Token Use | Format | Requested Audience | Requested Scope |
---|---|---|---|
/userinfo endpoint | Opaque | tenant name ({yourDomain} ), no value for audience parameter, no audience parameter passed | openid |
Auth0 Management API | JWT | Management API v2 identifier (https://.auth0.com/api/v2/ ) | |
Your own custom API | JWT | The API Identifier for your custom API registered in the Auth0 Dashboard |
openid
, then the resulting access token’s aud
claim will be an array rather than a string, and the access token will be valid for both your custom API and for the /userinfo
endpoint. Your access tokens can only have two or more audiences if you use a single custom API as well as Auth0’s /userinfo
endpoint.
iss)
claim of whichever domain you used when requesting the token. Custom domain users can use either their or their Auth0 domain.
For example, suppose you have a custom domain, https://login.northwind.com
. If you request an access token from https://login.northwind.com/authorize
, your token’s iss
claim will be https://login.northwind.com/
. However, if you request an access token from https://northwind.auth0.com/authorize
, your token’s iss
claim will be https://northwind.auth0.com/
.
If you request an access token from your custom domain with the target audience of the Auth0 , then you must call the Auth0 Management API from your custom domain. Otherwise your access token is considered invalid.