login

suspend fun login(context: Context, redirectUrl: String, scope: List<String>, extraRequestParameters: Map<String, String> = emptyMap()): Result<TokenInfo>

Initiates the OIDC Authorization Code redirect flow. Suspends until the browser redirect completes or the user cancels. Preferred over the String-scope overload.

Return

a Result containing TokenInfo on success, or a failed Result wrapping a FlowCancelledException if the user dismissed the browser, a FlowAlreadyInProgressException if another redirect flow was already in progress, or the underlying authorize/token exchange error.

Parameters

context

the Android Activity which is used to display the login flow via the configured WebAuthenticationProvider.

redirectUrl

the redirect URL.

scope

the scopes to request during sign in.

extraRequestParameters

the extra key value pairs to send to the authorize endpoint. See Authorize Documentation for parameter options.


suspend fun login(context: Context, redirectUrl: String, extraRequestParameters: Map<String, String> = emptyMap(), scope: String = defaultScopeValue.joinToString(" ")): OAuth2ClientResult<Token>

Deprecated

Use the overload accepting scope as a List<String> instead. Note that overload returns Result<TokenInfo> rather than OAuth2ClientResult<Token>, so it isn't a drop-in replacement — it cannot be offered as an automatic ReplaceWith.

Initiates the OIDC Authorization Code redirect flow.

Return

an OAuth2ClientResult: OAuth2ClientResult.Success wrapping the Token on success, or OAuth2ClientResult.Error wrapping a FlowCancelledException if the user dismissed the browser, a FlowAlreadyInProgressException if another redirect flow was already in progress, or the underlying authorize/token exchange error.

Parameters

context

the Android Activity which is used to display the login flow via the configured WebAuthenticationProvider.

redirectUrl

the redirect URL.

extraRequestParameters

the extra key value pairs to send to the authorize endpoint. See Authorize Documentation for parameter options.

scope

the scopes to request during sign in. Defaults to the configured client's default scope.