WebAuthentication

class WebAuthentication(client: OAuth2Client, webAuthenticationProvider: WebAuthenticationProvider = DefaultWebAuthenticationProvider(client.configuration.eventCoordinator))

Authentication coordinator that simplifies signing users in using browser-based OIDC authentication flows.

This simple class encapsulates the details of launching the browser, and coordinating with OAuth2 endpoints.

To customize the flow, please read more about customization options: WebAuthenticationProvider, CustomizeBrowserEvent, CustomizeCustomTabsEvent. To further customize the authentication flow, please read more about the underlying flows: AuthorizationCodeFlow, RedirectEndSessionFlow.

Constructors

Link copied to clipboard
constructor(webAuthenticationProvider: WebAuthenticationProvider = DefaultWebAuthenticationProvider(OidcConfiguration.default.eventCoordinator))

Initializes a web authentication client.

constructor(oidcConfiguration: OidcConfiguration, webAuthenticationProvider: WebAuthenticationProvider = DefaultWebAuthenticationProvider(oidcConfiguration.eventCoordinator))

Initializes a web authentication client.

constructor(client: OAuth2Client, webAuthenticationProvider: WebAuthenticationProvider = DefaultWebAuthenticationProvider(client.configuration.eventCoordinator))

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
suspend fun login(context: Context, redirectUrl: String, extraRequestParameters: Map<String, String> = emptyMap(), scope: String = client.configuration.defaultScope): OAuth2ClientResult<Token>

Initiates the OIDC Authorization Code redirect flow.

Link copied to clipboard
suspend fun logoutOfBrowser(context: Context, redirectUrl: String, idToken: String): OAuth2ClientResult<Unit>

Initiates the OIDC logout redirect flow.