OAuthAuthorizationService

OAuthAuthorizationService class is responsible for handling OAuth authorization and authorization process. It provides methods to authorize the user, handle the redirect intent, fetch user information, perform logout, retrieve fresh access token, and get the authorization service.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Additional scopes to be requested during authorization. Default is empty.

Link copied to clipboard

Boolean value indicating whether unsecure connections are allowed.

Link copied to clipboard

The client ID registered in the FusionAuth server.

Link copied to clipboard
val context: ERROR CLASS: Symbol not found for Context

The Android application context.

Link copied to clipboard

The URL of the FusionAuth server.

Link copied to clipboard

The locale to be used for authorization. Default is null.

Link copied to clipboard

The tenant ID, or null if not applicable.

Link copied to clipboard

The token manager to handle token storage and retrieval, or null if not used.

Functions

Link copied to clipboard
suspend fun authorize(completedIntent: ERROR CLASS: Symbol not found for Intent, options: OAuthAuthorizeOptions? = null)

Authorizes the user using OAuth authorization.

Link copied to clipboard
suspend fun freshAccessToken(): String?

Retrieves a fresh access token.

Link copied to clipboard
suspend fun getUserInfo(): UserInfo?

Retrieves the user information for the authenticated user.

Link copied to clipboard
suspend fun handleRedirect(intent: ERROR CLASS: Symbol not found for Intent): FusionAuthState

Handles the redirect intent from the authorization process.

Link copied to clipboard
fun isAuthorized(intent: ERROR CLASS: Symbol not found for Intent): Boolean

Checks if the authorization process has succeeded by examining the given intent.

Link copied to clipboard
fun isCancelled(intent: ERROR CLASS: Symbol not found for Intent): Boolean

Checks if the authorization process has been cancelled by examining the given intent.

Link copied to clipboard
fun isLoggedOut(intent: ERROR CLASS: Symbol not found for Intent): Boolean

Checks if the logout process has succeeded by examining the given intent.

Link copied to clipboard
suspend fun logout(completedIntent: ERROR CLASS: Symbol not found for Intent, options: OAuthLogoutOptions? = null)

Log out the user.