- 21 Dec 2023
- 1 Minute to read
- Print
- DarkLight
- PDF
JSON Web Token
- Updated on 21 Dec 2023
- 1 Minute to read
- Print
- DarkLight
- PDF
Follow these steps to implement authentication with a refreshable token:
Login using the
/api/auth/mandate/request
or the/api/auth/generate_tokens
endpoint. An access token and a refresh token will be returned.The two tokens need to be stored for future use.
Any authenticated request will require the access token to be present in the HTTP header.
When the access token is about to expire, the refresh token can be used to obtain a new access token, using the
/api/auth/refresh_access_token
endpoint.If the JWT is refreshable, go to step 3 until the refresh token is about to expire. A new refresh token can be obtained using the previously obtained refresh token (which is about to expire) by using
/api/auth/update_refresh_token
endpoint.If the JWT is non-refreshable, a new login needs to be performed again to start over. Return to step 1.