OAuthUserConfiguration constructor
- {required Uri portalUri,
- required String clientId,
- required Uri redirectUri,
- String culture = '',
- int refreshTokenExpirationInterval = 0,
- int refreshTokenExchangeInterval = 0,
- int federatedTokenExpirationInterval = 0,
- bool showCancelButton = true,
- UserInterfaceStyle userInterfaceStyle = UserInterfaceStyle.unspecified,
- bool preferPrivateWebBrowserSession = false}
Creates an OAuth configuration with the specified parameters.
Parameters:
portalUri
— The URL of the portal to authenticate with.clientId
— A unique identifier associated with an application registered with the portal that assists with client/server OAuth authentication.redirectUri
— The URL that the OAuth login page redirects to when authentication completes.culture
— The OAuth login page is displayed in the language specified by the given culture code.refreshTokenExpirationInterval
— The requested expiration interval (in minutes) for the refreshToken generated by the OAuth request. The max interval can be overridden by the portal administrator.refreshTokenExchangeInterval
— 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.federatedTokenExpirationInterval
— The requested expiration interval (in minutes) for federated tokens generated using the OAuth credential.showCancelButton
— A Boolean value indicating whether to show "Cancel" button on the OAuth login page.userInterfaceStyle
— Constants indicating the interface style for the OAuth login page.preferPrivateWebBrowserSession
— A Boolean value indicating whether the OAuth login session should ask the browser for a private authentication session.
Implementation
factory OAuthUserConfiguration(
{required Uri portalUri,
required String clientId,
required Uri redirectUri,
String culture = '',
int refreshTokenExpirationInterval = 0,
int refreshTokenExchangeInterval = 0,
int federatedTokenExpirationInterval = 0,
bool showCancelButton = true,
UserInterfaceStyle userInterfaceStyle = UserInterfaceStyle.unspecified,
bool preferPrivateWebBrowserSession = false}) {
_initializeArcGISEnvironmentIfNeeded();
final corePortalUri = _CString(portalUri.toString());
final coreClientId = _CString(clientId);
final coreRedirectUri = _CString(redirectUri.toString());
final coreCulture = _CString(culture);
final handle = _withThrowingErrorHandler((errorHandler) {
return runtimecore.RT_OAuthUserConfiguration_create(
corePortalUri.bytes,
coreClientId.bytes,
coreRedirectUri.bytes,
coreCulture.bytes,
refreshTokenExpirationInterval,
refreshTokenExchangeInterval,
federatedTokenExpirationInterval,
showCancelButton,
userInterfaceStyle.coreValue,
preferPrivateWebBrowserSession,
errorHandler);
});
final OAuthUserConfiguration object =
OAuthUserConfiguration._withHandle(handle);
object._portalUri.cache(portalUri);
object._redirectUri.cache(redirectUri);
return object;
}