Class TokenCredential
Base class for credentials used to access token-secured ArcGIS resources.
Implements
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
| Target | Versions | 
|---|---|
| .NET Standard 2.0 | 100.3 - 200.8 | 
| .NET | 100.13 - 200.8 | 
| .NET Windows | 100.13 - 200.8 | 
| .NET Android | 200.0 - 200.8 | 
| .NET iOS | 200.0 - 200.8 | 
| .NET Framework | 100.0 - 200.8 | 
| Xamarin.Android | 100.0 - 100.15 | 
| Xamarin.iOS | 100.0 - 100.15 | 
| UWP | 100.0 - 200.8 |