These Auth0 tools help you modify your application to authenticate users:
- Quickstarts are the easiest way to implement authentication. They show you how to use Universal Login and Auth0’s language- and framework-specific SDKs.
- The Auth0 Authentication API is a reference for those who prefer to write code independently. First, identify which flow to use. Then follow the instructions to implement that flow.
Example POST to token URL
Parameters
Response
You receive anHTTP 200 response with a payload containing access_token, token_type, and expires_in values:
Control access token audience
When a user authenticates, you request an access token and include the target and scope of access in your request. The application uses the/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.
In only one specific instance, access tokens can have multiple target audiences. This requires that your custom API’s is set to RS256. To learn more, read Token Best Practices.
Multiple audiences
If you specify an audience of your custom API identifier and a scope ofopenid, 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.
Custom domains and the Auth0 Management API
Auth0 issues tokens with an issuer (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.