OAuthUserConfiguration class final
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.
- Implemented types
- Mixed-in types
Constructors
- OAuthUserConfiguration({required Uri portalUri, required String clientId, required Uri redirectUri, String culture = '', int refreshTokenExpirationInterval = 0, int refreshTokenExchangeInterval = 1440, int federatedTokenExpirationInterval = 0, bool showCancelButton = true, UserInterfaceStyle userInterfaceStyle = UserInterfaceStyle.unspecified, bool preferPrivateWebBrowserSession = false})
-
Creates an OAuth configuration with the specified parameters.
factory
-
OAuthUserConfiguration.fromJson(Map<
String, dynamic> json) -
Creates an instance of this class from JSON of the data type used by
jsonDecode.
factory
- OAuthUserConfiguration.fromJsonString(String jsonString)
-
Creates an instance of this class from a JSON String.
factory
Properties
- clientId → String
-
A unique identifier associated with an application registered with the
portal that assists with client/server OAuth authentication.
no setter
- culture → String
-
The OAuth login page is displayed in the language specified by the given
culture code.
no setter
- federatedTokenExpirationInterval → int
-
The requested expiration interval (in minutes) for federated tokens
generated using the OAuth credential.
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- portalUri → Uri
-
The URL of the portal to authenticate with.
no setter
- preferPrivateWebBrowserSession → bool
-
A Boolean value indicating whether the OAuth login session should ask the
browser for a private authentication session.
no setter
- redirectUri → Uri
-
The URL that the OAuth login page will redirect to when authentication
completes.
no setter
- refreshTokenExchangeInterval → int
-
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 login because of expiring tokens.
no setter
- refreshTokenExpirationInterval → int
-
The requested expiration interval (in minutes) for the refresh token. The
maximum interval can be overridden by the portal administrator.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showCancelButton → bool
-
A Boolean value indicating whether to show the "Cancel" button on the
OAuth login page.
no setter
- userInterfaceStyle → UserInterfaceStyle
-
Constants indicating the interface style for the OAuth login page.
no setter
Methods
-
canBeUsedForUri(
Uri uri) → bool - Checks if this configuration can be used for the given URL.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Returns a JSON representation of this Object in the data type used by jsonDecode.
inherited
-
toJsonString(
) → String -
Returns a JSON representation of this Object as a String.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override