ICredentialsProvider.GetCredentialAsync Method

Definition

Gets a credential to be used for authentication, based on the provided credential descriptions. The provider may choose to return a credential based on any of the provided descriptions, and is not required to return a credential for each description. The provider may also choose to return null, in which case the system will attempt to authenticate without client credentials, if applicable.

public System.Threading.Tasks.Task<Microsoft.Identity.Abstractions.CredentialDescription?> GetCredentialAsync(Microsoft.Identity.Abstractions.CredentialSourceLoaderParameters? credentialSourceLoaderParameters, System.Threading.CancellationToken cancellationToken);
abstract member GetCredentialAsync : Microsoft.Identity.Abstractions.CredentialSourceLoaderParameters * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Identity.Abstractions.CredentialDescription>
Public Function GetCredentialAsync (credentialSourceLoaderParameters As CredentialSourceLoaderParameters, cancellationToken As CancellationToken) As Task(Of CredentialDescription)

Parameters

credentialSourceLoaderParameters
CredentialSourceLoaderParameters

Parameters to use for credential selection.

cancellationToken
CancellationToken

The cancellation token.

Returns

A matching and loaded credential, if any are applicable.

Applies to