Default Token Manager
Default implementation for TokenManager. By default this class uses SecuredSharedPreferences to persist the token locally on the device. However, it can be overridden by the builder For example, it can replaced with Android JetPack androidx.security.crypto.EncryptedSharedPreferences
This TokenManager supports AccessToken in-memory caching. To control the caching interval use builder. with the encryption/decryption, disk and Keystore IO, it may drains device CPU and Battery resources. If Application intensively with network operation, setting the this attribute may improve performance.
Constructors
Link copied to clipboard
constructor(@NonNull context: Context, oAuth2Client: OAuth2Client, sharedPreferences: SharedPreferences, cacheIntervalMillis: Long, threshold: Long)
Properties
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
The OAuth2Client to auto refresh AccessToken
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
The SharedPreferences to store the tokens
Link copied to clipboard
Threshold to refresh the AccessToken
Link copied to clipboard
Functions
Link copied to clipboard
Cache the AccessToken in memory and setup a worker thread to clear it after.
Link copied to clipboard
Remove the stored AccessToken
Link copied to clipboard
open fun exchangeToken(@NonNull token: SSOToken, @NonNull additionalParameters: Map<String, String>, listener: FRListener<AccessToken>)
open fun exchangeToken(code: String, pkce: PKCE, additionalParameters: Map<String, String>, listener: FRListener<AccessToken>)
Sends an authorization request to the authorization service.
Link copied to clipboard
Get the AccessToken asynchronously, If the stored AccessToken is expired, auto refresh the token
Link copied to clipboard
Retrieve AccessToken from cache or from storage.
Link copied to clipboard
Persist the AccessToken to storage
Link copied to clipboard
Refresh the AccessToken asynchronously, force token refresh, no matter the stored AccessToken is expired or not refresh the token and persist it.
Link copied to clipboard
OAuth2 Token Revocation