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
public Task<TokenCredential> GenerateCredentialAsync(Uri serviceUri, string userName, string password, GenerateTokenOptions generateTokenOptions = null)
Parameters
Type Name Description
Uri serviceUri

The service Uri.

String userName

The user name.

String password

The password.

GenerateTokenOptions generateTokenOptions

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

Returns
Type Description
Task<TokenCredential>

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

Exceptions
Type Condition
ArgumentNullException

serviceUri

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.0
.NET 6.0100.13 - 200.0
.NET 6.0 Windows100.13 - 200.0
.NET 6.0 iOS200
.NET Framework100.0 - 200.0
.NET 5100.10 - 100.12
.NET Core 3.1100.7 - 100.12
Android100.0 - 100.14
iOS100.0 - 100.15
UWP100.0 - 200.0

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
public Task<TokenCredential> GenerateCredentialAsync(Uri serviceUri, GenerateTokenOptions generateTokenOptions = null)
Parameters
Type Name Description
Uri serviceUri

The URL.

GenerateTokenOptions generateTokenOptions

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

Returns
Type Description
Task<TokenCredential>

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

Exceptions
Type Condition
ArgumentNullException

serviceUri

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

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.0
.NET 6.0100.13 - 200.0
.NET 6.0 Windows100.13 - 200.0
.NET 6.0 iOS200
.NET Framework100.0 - 200.0
.NET 5100.10 - 100.12
.NET Core 3.1100.7 - 100.12
Android100.0 - 100.14
iOS100.0 - 100.15
UWP100.0 - 200.0
In This Article
Back to top Copyright © 2022 Esri.