LoginViewModel

open class LoginViewModel(val bootConfig: BootConfig, backgroundContext: CoroutineContext = IO) : ViewModel

View model for the login activity managing OAuth authorization URL generation, server selection, and authentication flow state.

Parameters

bootConfig

The boot configuration providing default OAuth client credentials, redirect URI, and scopes

backgroundContext

The coroutine context used for background work such as OAuth configuration resolution and URL generation. This parameter is intended for testing purposes only. Defaults to IO

Constructors

Link copied to clipboard
constructor(bootConfig: BootConfig, backgroundContext: CoroutineContext = IO)

Types

Link copied to clipboard
data class BottomBarButton(val title: String, val onClick: () -> Unit)

Models an additional bottom bar button the login view can display.

Link copied to clipboard
object Companion
Link copied to clipboard
inner class LoginUrlSource(viewModel: LoginViewModel = this@LoginViewModel, scope: CoroutineScope = viewModelScope) : Observer<String?>

An observer used to set the web view's OAuth authorization URL from the selected login server.

Link copied to clipboard

An observer used to set the pending login server from the login server manager's selected login server.

Properties

Link copied to clipboard
open var additionalParameters: <Error class: unknown class>

Additional Auth Values used for login.

Link copied to clipboard
Link copied to clipboard
open val bottomAppBar: @Composable () -> Unit? = null

BottomAppBar that will be used instead of the default.

Link copied to clipboard

The selected login server's OAuth authorization URL for use in the external browser custom tab when browser-based authentication is active. This provides the login flow with the requirements for advanced authentication, such as client certificates.

Link copied to clipboard

A custom button to display on the login view bottom app bar.

Link copied to clipboard

The Salesforce Identity API UI Bridge front door bridge URL for use in the web view when overriding the standard login URL

Link copied to clipboard
Link copied to clipboard
open val loadingIndicator: @Composable () -> Unit? = null

Loading Indicator

Link copied to clipboard

The selected login server's OAuth authorization URL for use in the web view when browser-based authentication is inactive

Link copied to clipboard

The login server that has been selected by the login server manager, has an authentication configuration and is ready for use

Link copied to clipboard
open val shouldShowBackButton: <Error class: unknown class>

Value representing if the back button should be shown on the login view.

Link copied to clipboard
Link copied to clipboard

Setting this option to true will enable a mode where only a custom tab will be shown. The first server will be launched in a custom tab immediately and the user will not be able to switch servers. The LoginActivity is ended if the user attempts to back out of the custom tab.

Link copied to clipboard
open var titleText: String?

TopAppBar text. Defaults to login server url.

Link copied to clipboard

TopAppBar text Color. Defaults to black on light backgrounds and white on dark backgrounds. Back and menu buttons will match this color.

Link copied to clipboard
open val topAppBar: @Composable () -> Unit? = null

TopAppBar that will be used instead of the default.

Link copied to clipboard
open var topBarColor: Color?

TopAppBar Color. Defaults to WebView background color.

Functions

Link copied to clipboard
open fun addCloseable(closeable: AutoCloseable)
fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
open fun clearCookies()

Clear WebView Cookies.

Link copied to clipboard
open fun clearWebViewCache(webView: WebView)

Clear WebView Cache.

Link copied to clipboard
Link copied to clipboard
fun loginWithFrontDoorBridgeUrl(frontdoorBridgeUrl: String, pkceCodeVerifier: String?)

Automatically log in using the provided UI Bridge API parameters.

Link copied to clipboard
open fun reloadWebView()

Reloads the WebView with a newly generated authorization URL.