<PackageReference Include="Azure.Core" Version="1.53.0" />

Azure.Identity.DeviceCodeCredential

A TokenCredential implementation which authenticates a user using the device code flow, and provides access tokens for that user account. For more information on the device code authentication flow see https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/wiki/Device-Code-Flow.

Creates a new DeviceCodeCredential, which will authenticate users using the device code flow.

Creates a new DeviceCodeCredential with the specified options, which will authenticate users using the device code flow.

public DeviceCodeCredential(Func<DeviceCodeInfo, CancellationToken, Task> deviceCodeCallback, string clientId, TokenCredentialOptions options = null)

Creates a new DeviceCodeCredential with the specified options, which will authenticate users with the specified application.

public DeviceCodeCredential(Func<DeviceCodeInfo, CancellationToken, Task> deviceCodeCallback, string tenantId, string clientId, TokenCredentialOptions options = null)

Creates a new DeviceCodeCredential with the specified options, which will authenticate users with the specified application.

public virtual AuthenticationRecord Authenticate(CancellationToken cancellationToken = default)

Interactively authenticates a user via the default browser.

public virtual AuthenticationRecord Authenticate(TokenRequestContext requestContext, CancellationToken cancellationToken = default)

Interactively authenticates a user via the default browser.

public virtual Task<AuthenticationRecord> AuthenticateAsync(CancellationToken cancellationToken = default)

Interactively authenticates a user via the default browser.

public virtual Task<AuthenticationRecord> AuthenticateAsync(TokenRequestContext requestContext, CancellationToken cancellationToken = default)

Interactively authenticates a user via the default browser.