Access token validation
This endpoint will validate your current access token and reissue if it has expired (provided a refresh token is present).
- A valid access token must be passed in the Bearer Authorization header (an expired access token is still valid)
- Access tokens have an automatic expiry of 72 hours. Refresh tokens may expire or become invalid due to Auth0 limitations and tenant policy, and excessive refresh token issuing can invalidate older tokens.
- If the access token is still valid, the response will return the current details and expiry
- If the access token has expired and no refresh token is provided, the API will return 401
- If receiving a 401 for an expired access token, pass
refresh_tokenand the API will return an updated access token and expiry when the refresh token is still valid. If refresh fails, prompt for reauthorization. - It is your responsibility to programmatically store and update your temporary access tokens. Long-lived access tokens are not issued for security purposes
Access token validation › Request Body
refresh_tokenRefresh Token. Only needed when a token is expired.
Access token validation › Responses
Response will be a JSON object containing an access token and refresh token. You can ignore any other information in the response as this is not necessary for API usage.
Example response for valid access token:
Code
Example response for expired access token + valid refresh token -> issues new access token
Code
Example response for expired access token with no refresh token passed in body
This will not give a 200 response -- will return a 400 bad request error.
Code
Password-based login (legacy)
NOTE: Avoid using this method. Rather, please log in normally and retrieve an access and refresh token via our UI. Only use this endpoint if you need to programmatically generate a new access/refresh token and do not currently have one, and for some reason cannot log in via the UI.
Password-based login (legacy) › Request Body
usernameYour login username
passwordYour password
issue_refresh_tokenOptional flag to return a refresh token in response
Password-based login (legacy) › Responses
Response will be a JSON object containing an access token and refresh token. You can ignore any other information in the response as this is not necessary for API usage.
Example response for valid login
Code