A token endpoint is an authorization server endpoint that exchanges an authorization code for an access token. Its URL appears in the discovery endpoint response. section 8.4.1
For the authorization code flow, the request includes:
- grant_type=authorization_code section 8.4.1
- The client ID, client secret, authorization code, and the same redirect URI used in the authorization request. section 8.4.1
- A POST request using the application/x-www-form-urlencoded MIME type. section 8.4.1
FastAPI exchange endpoint
A FastAPI GET /token endpoint accepts the returned code, builds the required form payload, posts it to Auth0’s https://apithreats.eu.auth0.com/oauth/token endpoint, and returns the response containing the access token.


