Show / Hide Table of Contents

Class TokenCredential

Base class for credentials used to access token-secured ArcGIS resources.

Inheritance
System.Object
Credential
TokenCredential
ArcGISTokenCredential
OAuthTokenCredential
Implements
System.ComponentModel.INotifyPropertyChanged
System.Runtime.Serialization.ISerializable
Credential.ServiceUri
Credential.ServerContext
Credential.PropertyChanged
Credential.ISerializable.GetObjectData(SerializationInfo, StreamingContext)
Credential.ToJson()
Credential.FromJson(String)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Esri.ArcGISRuntime.Security
Assembly: Esri.ArcGISRuntime.dll
Syntax
[Serializable]
[KnownType(typeof(string[]))]
[KnownType(typeof(GenerateTokenOptions))]
[KnownType(typeof(TokenAuthenticationType))]
[KnownType(typeof(DateTimeOffset? ))]
[Obsolete("Use ArcGISCredential instead.")]
public abstract class TokenCredential : Credential, INotifyPropertyChanged, ISerializable
Remarks

TokenCredential is deprecated in favor of ArcGISCredential. Depending on TokenAuthenticationType, you should use:

  • OAuthUserCredential for user authentication (OAuth 2.0 authorization code flow).
  • OAuthApplicationCredential for app authentication (OAuth 2.0 client credentials flow).
  • AccessTokenCredential for generating a token with a username and password.
  • PregeneratedTokenCredential when your app handles token generation manually or externally.

This is a base class for ArcGIS credentials requiring OAuth or ArcGIS Token authentication, such as OAuthTokenCredential and ArcGISTokenCredential.

You will generally get an instance of this class by calling GetCredentialAsync.

Properties

Name Description
ExpirationDate

Gets or sets the access token expiration date.

GenerateTokenOptions

Gets or sets the optional infos used to generate the token : referer, credentials, ....

IsSsl

Gets or sets a value indicating whether the token must always pass over ssl.

Token

Gets or sets the token used to access ArcGIS services with this credential.

UserName

Gets or sets the user associated with the Credential object.

Methods

Name Description
RefreshTokenAsync()

Refreshes the token.

Applies to

TargetVersions
.NET Standard 2.0100.3 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.0 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.0 - 200.7
Xamarin.Android100.0 - 100.15
Xamarin.iOS100.0 - 100.15
UWP100.0 - 200.7
In This Article
Back to top Copyright © 2022 Esri.