Show / Hide Table of Contents

Method CreateAsync

CreateAsync(Uri, string, string, TimeSpan, CancellationToken)

Creates an AccessTokenCredential with information needed to access an ArcGIS resource.

Declaration
public static Task<AccessTokenCredential> CreateAsync(Uri url, string username, string password, TimeSpan tokenExpirationInterval = default, CancellationToken cancellationToken = default)
Parameters
Type Name Description
Uri url

The URL of the token-secured resource.

string username

The case-sensitive username used to access the secured resource or retrieve a token.

string password

The password used to access the secured resource or retrieve a token.

TimeSpan tokenExpirationInterval

The duration the token will remain valid. The value must be greater than Zero, otherwise the server default is used.

CancellationToken cancellationToken

Cancellation token

Returns
Type Description
Task<AccessTokenCredential>

Returns an AccessTokenCredential.

Remarks

The expiration resolution is whole minutes; seconds are ignored.

Applies to

Platforms and versions
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.