AuthenticationCoreDef

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

Inheritors

Functions

Link copied to clipboard
abstract suspend 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
abstract suspend 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
abstract suspend fun clearTokens(context: Context): Unit?

Clear the tokens from the token data store.

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

Exchange the authorization code for the access token.

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

Get the access token from the token data store.

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

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

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

Get the basic user information of the authenticated.

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

Get the decoded ID token

Link copied to clipboard
abstract suspend 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
abstract suspend fun getIDToken(context: Context): String?

Get the ID token from the token data store.

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

Get the refresh token from the token data store.

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

Get the scope from the token data store.

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

Get the TokenState from the data store.

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

Logout the user from the application.

Link copied to clipboard
abstract suspend 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
abstract suspend fun performRefreshTokenGrant(context: Context, tokenState: TokenState): TokenState?

Perform the refresh token grant.

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

Save the TokenState to the data store.

Link copied to clipboard
abstract suspend 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.