Show / Hide Table of Contents

Method GetCredentialAsync

GetCredentialAsync(CredentialRequestInfo, Boolean)

Returns a Credential object of the specified type (credentialRequestInfo.AuthenticationType) that can be used to access the secured resource identified by the input url (credentialRequestInfo.Url). If required, the challenge method will be called and should return the expected credential object. If case of Token AuthenticationType, the user is typically challenged for a username and password which are used to generate a token. This method is typically called internally when a request fails due to an "invalid credentials" error.

Declaration
public Task<Credential> GetCredentialAsync(CredentialRequestInfo credentialRequestInfo, bool retry)
Parameters
Type Name Description
CredentialRequestInfo credentialRequestInfo

The information about the credential to get.

Boolean retry

Indicates if the method should make additional attempts to get the credentials after a failure (i.e. if true, the challenge method will be called in any case)

Returns
Type Description
Task<Credential>

The task object representing the asynchronous get credential operation. The value of the task result is a Credential object.

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 Android200
.NET 6.0 iOS200
.NET Framework100.0 - 200.0
.NET 5100.10 - 100.12
.NET Core 3.1100.7 - 100.12
Android100.0 - 100.15
iOS100.0 - 100.15
UWP100.0 - 200.0
In This Article
Back to top Copyright © 2022 Esri.