Token Endpoint
The token endpoint is a URL on an authorization server that an application contacts to obtain tokens after a user or client has been authorized. In most deployments the application sends proof of an authorization grant to this endpoint and receives tokens it can use to access protected resources. It is a back-channel endpoint, meaning the application calls it directly rather than routing the request through the user's browser.
The token endpoint is defined by the OAuth 2.0 Authorization Framework as the server endpoint the client uses to exchange an authorization grant (for example, an authorization code) or a refresh token for an access token, and optionally a refresh token. It is used by all OAuth 2.0 grant types except the Implicit Flow, where the authorization endpoint issues the access token directly. In OpenID Connect Core 1.0, the token endpoint additionally returns an ID Token when OIDC flows request it; for the Authorization Code Flow the ID Token returned from the token endpoint is specified in Section 3.1.3.6, and for the Hybrid Flow in Sections 3.3.3.6 and 3.3.3.7. Depending on the grant and profile, requests to this endpoint carry client authentication and grant-specific parameters, and it should be distinguished from the authorization endpoint (which handles the front-channel, user-facing authorization step) and from token introspection or activation endpoints that report on an existing token's state.
Why it matters
The token endpoint is the point at which an authorization grant becomes usable credentials. Because it converts an authorization code or refresh token into an access token, and, in OpenID Connect flows, an ID Token, it is one of the most security-sensitive surfaces of an authorization server. As a back-channel endpoint, it is called directly by the application rather than through the user's browser, which allows it to carry client authentication and to keep issued tokens out of the front-channel where they would be more exposed to interception or leakage through browser history and referrer headers.
Getting the token endpoint's role right also matters for correctly reasoning about what each OAuth 2.0 and OpenID Connect flow does. All OAuth 2.0 grant types except the Implicit Flow rely on the token endpoint to issue tokens; the Implicit Flow instead has the authorization endpoint issue the access token directly. Confusing these two endpoints, or conflating the token endpoint with introspection or activation endpoints that merely report on an existing token's state, leads to design and audit errors, such as assuming client authentication happens where it does not, or expecting an ID Token from a flow or endpoint that does not produce one.
Who it's relevant to
Inside Token Endpoint
Common questions
Answers to the questions practitioners most commonly ask about Token Endpoint.