OAuthUserConfiguration

The OAuth user configuration information used by an OAuthUserCredential. The portal URL, client ID, and redirect URL are required to create an OAuthUserCredential. You can get the client ID and redirect URL by following the Create OAuth credentials for user authentication tutorial.

To configure the lifetime of an OAuthUserCredential, set the desired refresh token expiration and exchange intervals.

  • Default behavior: The refresh token expires after 14 days and is exchanged every 24 hours, allowing users to remain logged in unless the app is unused for the entire two-week period.

  • Require re-authentication: Set the exchange interval to 0 to ensure users must log in again once the refresh token expires.

Creating an OAuthUserCredential displays an OAuth login page to the user. To customize the appearance of the login page, adjust parameters such as OAuthUserConfiguration.showCancelButton or OAuthUserConfiguration.userInterfaceStyle.

Since

200.1.0

Constructors

Link copied to clipboard
constructor(portalUrl: String, clientId: String, redirectUrl: String, culture: Locale = Locale.getDefault(), refreshTokenExpirationInterval: RefreshTokenExpirationInterval = RefreshTokenExpirationInterval.Default, refreshTokenExchangeInterval: RefreshTokenExchangeInterval = RefreshTokenExchangeInterval.Minutes(1440), federatedTokenExpirationInterval: Int? = null, showCancelButton: Boolean = true, userInterfaceStyle: OAuthUserConfiguration.UserInterfaceStyle = UserInterfaceStyle.Unspecified, preferPrivateWebBrowserSession: Boolean = false)

Creates an OAuth configuration with the specified parameters.

Types

Link copied to clipboard
object Companion
Link copied to clipboard
sealed class UserInterfaceStyle

Constants indicating the interface style.

Properties

Link copied to clipboard

A unique identifier associated with an application registered with the portal that assists with client/server OAuth authentication.

Link copied to clipboard

The OAuth login page is displayed in the language specified by the given culture code. If not explicitly set, the culture used by the device is used. If the culture is not supported by the portal then OAuth login page will be displayed in the language corresponding to culture specified in the portal/organization settings.

Link copied to clipboard

The requested expiration interval (in minutes) for federated tokens generated using the OAuth credential.

Link copied to clipboard

The URL of the portal to authenticate with.

Link copied to clipboard

A Boolean value indicating whether the OAuth login session should ask the browser for a private authentication session.

Link copied to clipboard

The URL that the OAuth login page will redirect to when authentication completes.

Link copied to clipboard

The requested exchange interval (in minutes) for the OAuth refresh token. Use this to exchange a refresh token before it expires. This will limit the number of times a user will have to log-in because of expiring tokens.

Link copied to clipboard

The requested expiration interval (in minutes) for the refresh token. The maximum interval can be overridden by the portal administrator.

Link copied to clipboard

A Boolean value indicating whether to show the "Cancel" button on the OAuth login page.

Link copied to clipboard

Constants indicating the interface style for the OAuth login page. The default is OAuthUserConfiguration.UserInterfaceStyle.Unspecified.

Functions

Link copied to clipboard

Checks if this configuration can be used for the given URL.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int

Inherited functions

Link copied to clipboard
open override fun toJson(): String

Convert an object to JSON string.