你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

IAuthenticator.TryAuthenticate Method

Definition

Overloads

TryAuthenticate(AuthenticationParameters, Task<IAccessToken>)

Determine if this request can be authenticated using the given authenticator, and authenticate if it can

TryAuthenticate(AuthenticationParameters, CancellationToken, Task<IAccessToken>)

Determine if this request can be authenticated using the given authenticator, and authenticate if it can

TryAuthenticate(AuthenticationParameters, Task<IAccessToken>)

Determine if this request can be authenticated using the given authenticator, and authenticate if it can

public bool TryAuthenticate (Microsoft.Azure.Commands.Common.Authentication.AuthenticationParameters parameters, out System.Threading.Tasks.Task<Microsoft.Azure.Commands.Common.Authentication.IAccessToken> token);
abstract member TryAuthenticate : Microsoft.Azure.Commands.Common.Authentication.AuthenticationParameters * Task -> bool
Public Function TryAuthenticate (parameters As AuthenticationParameters, ByRef token As Task(Of IAccessToken)) As Boolean

Parameters

parameters
AuthenticationParameters

The complex object containing authentication specific information (e.g., tenant, token cache, etc.)

token
Task<IAccessToken>

The token based authentication information

Returns

Applies to

TryAuthenticate(AuthenticationParameters, CancellationToken, Task<IAccessToken>)

Determine if this request can be authenticated using the given authenticator, and authenticate if it can

public bool TryAuthenticate (Microsoft.Azure.Commands.Common.Authentication.AuthenticationParameters parameters, System.Threading.CancellationToken cancellationToken, out System.Threading.Tasks.Task<Microsoft.Azure.Commands.Common.Authentication.IAccessToken> token);
abstract member TryAuthenticate : Microsoft.Azure.Commands.Common.Authentication.AuthenticationParameters * System.Threading.CancellationToken * Task -> bool
Public Function TryAuthenticate (parameters As AuthenticationParameters, cancellationToken As CancellationToken, ByRef token As Task(Of IAccessToken)) As Boolean

Parameters

parameters
AuthenticationParameters

The complex object containing authentication specific information (e.g., tenant, token cache, etc.)

cancellationToken
CancellationToken

The cancellation token provided from the cmdlet to halt authentication.

token
Task<IAccessToken>

The token based authentication information

Returns

Applies to