AuthenticationCore

Authentication core class which has the core functionality of the Authenticator SDK.

Parameters

authenticationCoreConfigProvider

Provider to get the updated AuthenticationCoreConfig based on the discovery response. AuthenticationCoreConfigProvider

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open suspend override fun authn(authenticator: Authenticator, authenticatorParameters: LinkedHashMap<String, String>): AuthenticationFlow?

Send the authentication parameters to the authentication endpoint and get the next step of the authentication flow. If the authentication flow has only one step, this method will return the success response of the authentication flow if the authentication is successful.

Link copied to clipboard
open suspend override fun authorize(): AuthenticationFlow?

Authorize the application. This method will call the authorization endpoint and get the authenticators available for the first step in the authentication flow.

Link copied to clipboard
open suspend override fun clearTokens(context: Context): Unit?

Clear the tokens from the token data store.

Link copied to clipboard
open suspend override fun exchangeAuthorizationCode(authorizationCode: String, context: Context): TokenState?

Exchange the authorization code for the access token.

Link copied to clipboard
open suspend override fun getAccessToken(context: Context): String?

Get the access token from the token data store.

Link copied to clipboard
open suspend override fun getAccessTokenExpirationTime(context: Context): Long?

Get the access token expiration time from the token data store.

Link copied to clipboard
open suspend override fun getBasicUserInfo(accessToken: String?): LinkedHashMap<String, Any>?

Get the basic user information of the authenticated.

Link copied to clipboard
open override fun getDecodedIDToken(context: Context, idToken: String): LinkedHashMap<String, Any>

Get the decoded ID token

Link copied to clipboard
open suspend override fun getDetailsOfAuthenticator(authenticator: Authenticator): Authenticator

Get the authenticator details of the given authenticator. This should call before authenticating with the any authenticator.

Link copied to clipboard
open suspend override fun getIDToken(context: Context): String?

Get the ID token from the token data store.

Link copied to clipboard
open suspend override fun getRefreshToken(context: Context): String?

Get the refresh token from the token data store.

Link copied to clipboard
open suspend override fun getScope(context: Context): String?

Get the scope from the token data store.

Link copied to clipboard
open suspend override fun getTokenState(context: Context): TokenState?

Get the TokenState from the data store.

Link copied to clipboard
open suspend override fun logout(idToken: String)

Logout the user from the application.

Link copied to clipboard
open suspend override fun performAction(context: Context, tokenState: TokenState, action: suspend (String?, String?) -> Unit): TokenState?

Perform an action with the tokens. If the token is expired, it will perform the refresh the tokens, and then perform the action. This will also update the token in the data store as well.

Link copied to clipboard
open suspend override fun performRefreshTokenGrant(context: Context, tokenState: TokenState): TokenState?

Perform the refresh token grant.

Link copied to clipboard
open suspend override fun saveTokenState(context: Context, tokenState: TokenState): Unit?

Save the TokenState to the data store.

Link copied to clipboard
open suspend override fun validateAccessToken(context: Context): Boolean?

Validate the access token, by checking the expiration time of the access token, and by checking if the access token is null or empty.