Show / Hide Table of Contents

Method GenerateCredentialAsync

GenerateCredentialAsync(Uri, String, String, GenerateTokenOptions)

Generates a token credential object asynchronously. You need to provide the service URI, the username and the password. This is a helper method typically called by the UI challenging the user.

Declaration
[Obsolete("Use AccessTokenCredential.CreateAsync to create token credentials with username and password.")]
public Task<TokenCredential> GenerateCredentialAsync(Uri serviceUri, string userName, string password, GenerateTokenOptions generateTokenOptions = null)
Parameters
Type Name Description
System.Uri serviceUri

The service Uri.

System.String userName

The user name.

System.String password

The password.

GenerateTokenOptions generateTokenOptions

The optional infos concerning the token to generate (referer, credentials).

Returns
Type Description
System.Threading.Tasks.Task<TokenCredential>

The task object representing the asynchronous generate credential operation. The value of the task result is a TokenCredential object.

Exceptions
Type Condition
System.ArgumentNullException

serviceUri

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.2 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.0 - 200.7
Xamarin.Android100.0 - 100.14
Xamarin.iOS100.0 - 100.15
UWP100.0 - 200.7

GenerateCredentialAsync(Uri, GenerateTokenOptions)

Generates a token credential object asynchronously. You need to provide the service URL. This is a helper method typically called by the UI challenging the user.

Declaration
[Obsolete("Use AccessTokenCredential.CreateNetworkSecuredAsync to create network-secured or federated token credentials.")]
public Task<TokenCredential> GenerateCredentialAsync(Uri serviceUri, GenerateTokenOptions generateTokenOptions = null)
Parameters
Type Name Description
System.Uri serviceUri

The URL.

GenerateTokenOptions generateTokenOptions

The optional infos concerning the token to generate (referer, credentials).

Returns
Type Description
System.Threading.Tasks.Task<TokenCredential>

The task object representing the asynchronous generate credential operation. The value of the task result is a TokenCredential object.

Exceptions
Type Condition
System.ArgumentNullException

serviceUri

See Also
GenerateCredentialAsync(Uri, String, String, GenerateTokenOptions)

Applies to

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