共用方式為


IAuthorizationService.GetCredentialsAsync(CancellationToken) Method

Definition

Gets the data to include in the ClientCredentials property of a service request.

public System.Threading.Tasks.ValueTask<System.Collections.Generic.IReadOnlyDictionary<string,string>> GetCredentialsAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member GetCredentialsAsync : System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Collections.Generic.IReadOnlyDictionary<string, string>>
Public Function GetCredentialsAsync (Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of IReadOnlyDictionary(Of String, String))

Parameters

cancellationToken
CancellationToken

A cancellation token.

Returns

A set of credentials.

Exceptions

Thrown when credentials are not available, are expired beyond recovery, or revoked.

Remarks

If this service was created with credentials in ClientCredentials, this method will return that same set or perhaps a refreshed set representing the same client. If this service was created without credentials, credentials are obtained from the identity running the process hosting this service.

Applies to