Show / Hide Table of Contents

Class OAuthUserCredential

A credential that accesses OAuth token-secured ArcGIS resources using an OAuthUserConfiguration.

Inheritance
object
Credential
ArcGISCredential
OAuthUserCredential
Implements
INotifyPropertyChanged
ArcGISCredential.Referer
ArcGISCredential.Username
Credential.ServerContext
Credential.PropertyChanged
Credential.FromJson(string)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Esri.ArcGISRuntime.Security
Assembly: Esri.ArcGISRuntime.dll
Syntax
public sealed class OAuthUserCredential : ArcGISCredential, INotifyPropertyChanged
Remarks

The OAuth user credential generates a short-lived access token that gives the user permission to access token-secured ArcGIS content and services, such as the ArcGIS location services.

To configure the lifetime of this credential, set the desired refresh token expiration and exchange intervals on the OAuthUserConfiguration.

  • Default behavior: The refresh token expires after two weeks 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 a negative value to ensure users must log in again once the refresh token expires.

Creating this credential displays an OAuth login page to the user. To customize the appearance of the login page, adjust parameters such as ShowCancelButton or UserInterfaceStyle.

If you use this OAuthUserCredential as part of the secure resource challenge handling, it will be stored with the AuthenticationManager. It will be used by all subsequent requests that have a matching URL context.

Properties

Name Description
AuthorizationCode

Gets an authorization code to generate the OAuth token.

Configuration

Gets the OAuth configuration details of an application that can sign into an ArcGIS Online or ArcGIS Enterprise portal using OAuth.

Methods

Name Description
CreateAsync(OAuthUserConfiguration, object?, CancellationToken)

Creates an OAuthUserCredential with information needed to access an ArcGIS resource. This initiates the OAuth login process by presenting the OAuth login page.

CreateAsync(OAuthUserConfiguration, CancellationToken)

Creates an OAuthUserCredential with information needed to access an ArcGIS resource. This initiates the OAuth login process by presenting the OAuth login page.

GetTokenInfoAsync(CancellationToken)

Returns an instance of OAuthUserTokenInfo generated by this credential.

RevokeTokenAsync(CancellationToken)

Sends a network request to revoke OAuth refresh and access tokens.

ToJson()

Convert an object to JSON string.

Applies to

TargetVersions
.NET Standard 2.0200.6 - 200.8
.NET200.6 - 300.0
.NET Windows200.6 - 300.0
.NET Android200.6 - 300.0
.NET iOS200.6 - 300.0
.NET Framework200.6 - 200.8
UWP200.6 - 200.8
In this article
Provide feedback
Back to top Copyright © 2025 Esri.