Contents
Can refresh token be reused?
When a client uses a refresh token, it always receives a new refresh token for next time. As a result, refresh tokens are only used once. In these scenarios, the reuse of a refresh token triggers all kinds of alarms with the authorization server.
Is refresh token a secret?
Typically, refresh tokens are only used with confidential clients. However, since it is possible to use the authorization code flow without a client secret, the refresh grant may also be used by clients that don’t have a secret. If the client was issued a secret, then the client must authenticate this request.
Is refresh token necessary in JWT?
JWT Token has an expiration of 2 hours. The token is refreshed every hour by the client. If the user token is not refreshed (user is inactive and the app is not open) and expires, they will need to log in whenever they want to resume.
How do I make refresh token safe?
How to secure a refresh token?
- authenticate.
- store access token + refresh token somewhere (in my case, access token on the front-end and refresh token on the back-end)
- when performing an api request, validate the access token on the api side.
How to handle the use of refresh tokens?
You can just use the refresh token for each access. User logs in, gets access and refresh token. Access token lifetime 15min, refresh token 5 days. User accesses the service using the access token. Service only checks signature and lifetime. No database connection.
When to delete Microsoft identity platform refresh tokens?
The Microsoft identity platform doesn’t revoke refresh tokens when used to fetch new access tokens. Securely delete the old refresh token after acquiring a new one. Refresh tokens need to be stored safely like access tokens or application credentials.
How are refresh tokens protected in OAuth2?
The OAuth2 token endpoint (/oauth/token) handles issuing of all types of grants (password and refresh tokens). All other endpoints are protected by the OAuth2 middleware that checks for the access token.
Can a refresh token be blacklisted by a server?
Refresh tokens are usually subject to strict storage requirements to ensure they are not leaked. They can also be blacklisted by the authorization server. Whether tokens are opaque or not is usually defined by the implementation. Common implementations allow for direct authorization checks against an access token.