Delen via


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