access_token
) is an opaque string representing an authorization issued to the application. It may denote an identifier used to retrieve the authorization information or may self-contain the authorization information (for example, the user’s identity, permissions, and so forth) in a verifiable manner.
It is quite common for Access Tokens to be implemented as JSON Web Tokens.
For more information on Auth0 Access Tokens refer to Access Token.
An API can enforce fine-grained control over who can access the various endpoints exposed by the API. These permissions are expressed as scopes.
When a user authorizes a client application, the application can also indicate which permissions it requires. The user is then allowed to review and grant these permissions. These permissions are then included in the Access Token as part of the scope
claim.
Subsequently, when the client passes along the Access Token when making requests to the API, the API can inspect the scope
claim to ensure that the required permissions were granted in order to call the particular API endpoint.
read:timesheets
), creating timesheets (scope create:timesheets
), deleting timesheets (scope delete:timesheets
) and approving timesheets (scope approve:timesheets
).
When a client asks the API to create a new timesheet entry, then the Access Token should contain the create:timesheets
scope. In a similar fashion, in order to delete existing timesheets, the Access Token should contain the delete:timesheets
scope.
For more information on scopes refer to Scopes.
By using the authorization framework, you can give your own applications or third-party applications limited access to your APIs on behalf of the application itself. Using Auth0, you can easily support different flows in your own APIs without worrying about the OAuth 2.0/ Connect (OIDC) specification, or the many other technical aspects of API authorization.
authorization_code
returned by Auth0 and exchange it for an Access Token (and possibly a Refresh Token).
The Proof Key for Code Exchange (PKCE) (defined in RFC 7636) is a technique used to mitigate this authorization code interception attack.
With PKCE, the Application creates, for every authorization request, a cryptographically random key called code_verifier
and its transformed value called code_challenge
, which is sent to Auth0 to get the authorization_code
. When the Application receives the authorization_code
, it will send the code and the code_verifier
to Auth0’s to exchange them for the requested tokens.
code_challenge
and code_challenge_method
parameters.authorization_code
in the query string.authorization_code
and code_verifier
together with the redirect_uri
and the client_id
to Auth0. This is done using the /oauth/token endpoint.