Show / Hide Table of Contents

Constructor OAuthUserConfiguration

OAuthUserConfiguration(Uri, string, Uri, CultureInfo?, TimeSpan, TimeSpan, TimeSpan, bool, UserInterfaceStyle, bool)

Initializes a new instance of the OAuthUserConfiguration class with the specified parameters.

Declaration
public OAuthUserConfiguration(Uri portalUrl, string clientId, Uri redirectUrl, CultureInfo? culture = null, TimeSpan refreshTokenExpirationInterval = default, TimeSpan refreshTokenExchangeInterval = default, TimeSpan federatedTokenExpirationInterval = default, bool showCancelButton = true, UserInterfaceStyle userInterfaceStyle = UserInterfaceStyle.Unspecified, bool preferPrivateWebBrowserSession = false)
Parameters
Type Name Description
Uri portalUrl

The URL of the portal to authenticate with.

string clientId

The unique identifier for the application registered with the portal used for client/server OAuth authentication.

Uri redirectUrl

The URI that the OAuth login page redirects to when authentication completes.

CultureInfo culture

A CultureInfo object specifying the language of the OAuth login page. If not specified or set to null, CurrentUICulture is used. If the specified culture is unsupported, the OAuth login page defaults to the portal's configured language. Example: new CultureInfo("en-US").

TimeSpan refreshTokenExpirationInterval

The requested expiration interval for refresh tokens generated by the OAuth request. Set this parameter to MaxValue to request the maximum supported refresh token duration (90 days). Note that the portal administrator can override this maximum duration.

TimeSpan refreshTokenExchangeInterval

The interval at which the OAuth refresh token is exchanged (rotated) before expiration. This setting reduces how frequently active users must sign in again due to expired tokens. If not specified or set to Zero, the default exchange interval (24 hours) is used. A negative value disables token exchange entirely, causing refresh tokens to expire after the refreshTokenExpirationInterval, even if users remain active. To be effective, this interval must be shorter than the refreshTokenExpirationInterval, and the credential has to be used at least once before expiration. Keeping this interval short (between several hours and one day) reduces security risks associated with long-lived tokens. Given value is rounded to the nearest whole minute; seconds are ignored.

TimeSpan federatedTokenExpirationInterval

The requested expiration interval for federated tokens generated using OAuth credentials.

bool showCancelButton

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

UserInterfaceStyle userInterfaceStyle

A value indicating the interface style of the OAuth login page (light or dark).

bool preferPrivateWebBrowserSession

A value indicating whether the OAuth login should request a private browsing session from the browser.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0200.5 - 200.8
.NET200.5 - 300.0
.NET Windows200.5 - 300.0
.NET Android200.5 - 300.0
.NET iOS200.5 - 300.0
.NET Framework200.5 - 200.8
UWP200.5 - 200.8
In this article
Provide feedback
Back to top Copyright © 2025 Esri.