AzureCredentialsFactory.FromDevice Method

Definition

Creates a credentials object through device flow.

public Microsoft.Azure.Management.ResourceManager.Fluent.Authentication.AzureCredentials FromDevice (string clientId, string tenantId, Microsoft.Azure.Management.ResourceManager.Fluent.AzureEnvironment environment, Func<Microsoft.IdentityModel.Clients.ActiveDirectory.DeviceCodeResult,bool> deviceCodeFlowHandler = default);
member this.FromDevice : string * string * Microsoft.Azure.Management.ResourceManager.Fluent.AzureEnvironment * Func<Microsoft.IdentityModel.Clients.ActiveDirectory.DeviceCodeResult, bool> -> Microsoft.Azure.Management.ResourceManager.Fluent.Authentication.AzureCredentials
Public Function FromDevice (clientId As String, tenantId As String, environment As AzureEnvironment, Optional deviceCodeFlowHandler As Func(Of DeviceCodeResult, Boolean) = Nothing) As AzureCredentials

Parameters

clientId
String

the client ID of the application

tenantId
String

the tenant ID or domain

environment
AzureEnvironment

the environment to authenticate to

deviceCodeFlowHandler
Func<Microsoft.IdentityModel.Clients.ActiveDirectory.DeviceCodeResult,Boolean>

a user defined function to handle device flow

Returns

an authenticated credentials object

Applies to