This function is called when an M_UNKNOWN_TOKEN error is encountered. It will attempt to refresh the access token if it is unknown, and will return a TokenRefreshOutcome.
the snapshot returned by prepareForRequest
the number of attempts made for this request so far
a TokenRefreshOutcome indicating the result of the refresh attempt
This function is called before every request to ensure that the access token is valid.
a snapshot containing the access token and other properties which must be passed to the handleUnknownToken handler if an M_UNKNOWN_TOKEN error is encountered.
Attempt to revoke the current access and refresh tokens with the OAuth2 authorization server, e.g. as
part of logging out. Does nothing if this is not an OAuth2-native session (ie. no oauth2ClientConfig
was supplied).
This class is responsible for managing the access token and refresh token for authenticated requests. It will automatically refresh the tokens when the access token is about to expire and can handle Unknown Token errors (via TokenManager.handleUnknownToken)
It will update the Opts object with new tokens as they are refreshed, and also call the IHttpOpts.onTokenRefresh callback if provided.