UserTokenProvider.LoginByDeviceCodeAsync Method

Definition

Overloads

LoginByDeviceCodeAsync(String, Func<DeviceCodeResult,Boolean>)

Log in to azure active directory using device code authentication.

LoginByDeviceCodeAsync(String, String, Func<DeviceCodeResult,Boolean>)

Log in to azure active directory using device code authentication.

LoginByDeviceCodeAsync(String, String, TokenCache, Func<DeviceCodeResult,Boolean>)

Log in to azure active directory using device code authentication.

LoginByDeviceCodeAsync(String, String, ActiveDirectoryServiceSettings, Func<DeviceCodeResult,Boolean>)

Log in to azure active directory using device code authentication.

LoginByDeviceCodeAsync(String, String, ActiveDirectoryServiceSettings, TokenCache, Func<DeviceCodeResult,Boolean>)

Log in to azure active directory using device code authentication.

LoginByDeviceCodeAsync(String, Func<DeviceCodeResult,Boolean>)

Log in to azure active directory using device code authentication.

public static System.Threading.Tasks.Task<Microsoft.Rest.ServiceClientCredentials> LoginByDeviceCodeAsync (string clientId, Func<Microsoft.IdentityModel.Clients.ActiveDirectory.DeviceCodeResult,bool> deviceCodeHandler);
static member LoginByDeviceCodeAsync : string * Func<Microsoft.IdentityModel.Clients.ActiveDirectory.DeviceCodeResult, bool> -> System.Threading.Tasks.Task<Microsoft.Rest.ServiceClientCredentials>
Public Shared Function LoginByDeviceCodeAsync (clientId As String, deviceCodeHandler As Func(Of DeviceCodeResult, Boolean)) As Task(Of ServiceClientCredentials)

Parameters

clientId
System.String

The active directory client id for this application.

deviceCodeHandler
System.Func<DeviceCodeResult,System.Boolean>

User provided callback to display device code request. if returns false no token will be acquired.

Returns

System.Threading.Tasks.Task<ServiceClientCredentials>

A ServiceClientCredentials object that can be used to authenticate http requests using the given credentials.

Applies to

LoginByDeviceCodeAsync(String, String, Func<DeviceCodeResult,Boolean>)

Log in to azure active directory using device code authentication.

public static System.Threading.Tasks.Task<Microsoft.Rest.ServiceClientCredentials> LoginByDeviceCodeAsync (string clientId, string domain, Func<Microsoft.IdentityModel.Clients.ActiveDirectory.DeviceCodeResult,bool> deviceCodeHandler);
static member LoginByDeviceCodeAsync : string * string * Func<Microsoft.IdentityModel.Clients.ActiveDirectory.DeviceCodeResult, bool> -> System.Threading.Tasks.Task<Microsoft.Rest.ServiceClientCredentials>
Public Shared Function LoginByDeviceCodeAsync (clientId As String, domain As String, deviceCodeHandler As Func(Of DeviceCodeResult, Boolean)) As Task(Of ServiceClientCredentials)

Parameters

clientId
System.String

The active directory client id for this application.

domain
System.String

The active directory domain or tenant id to authenticate with.

deviceCodeHandler
System.Func<DeviceCodeResult,System.Boolean>

User provided callback to display device code request. if returns false no token will be acquired.

Returns

System.Threading.Tasks.Task<ServiceClientCredentials>

A ServiceClientCredentials object that can be used to authenticate http requests using the given credentials.

Applies to

LoginByDeviceCodeAsync(String, String, TokenCache, Func<DeviceCodeResult,Boolean>)

Log in to azure active directory using device code authentication.

public static System.Threading.Tasks.Task<Microsoft.Rest.ServiceClientCredentials> LoginByDeviceCodeAsync (string clientId, string domain, Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache cache, Func<Microsoft.IdentityModel.Clients.ActiveDirectory.DeviceCodeResult,bool> deviceCodeHandler);
static member LoginByDeviceCodeAsync : string * string * Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache * Func<Microsoft.IdentityModel.Clients.ActiveDirectory.DeviceCodeResult, bool> -> System.Threading.Tasks.Task<Microsoft.Rest.ServiceClientCredentials>
Public Shared Function LoginByDeviceCodeAsync (clientId As String, domain As String, cache As TokenCache, deviceCodeHandler As Func(Of DeviceCodeResult, Boolean)) As Task(Of ServiceClientCredentials)

Parameters

clientId
System.String

The active directory client id for this application.

domain
System.String

The active directory domain or tenant id to authenticate with.

cache
TokenCache

The token cache to target during authentication.

deviceCodeHandler
System.Func<DeviceCodeResult,System.Boolean>

User provided callback to display device code request. if returns false no token will be acquired.

Returns

System.Threading.Tasks.Task<ServiceClientCredentials>

A ServiceClientCredentials object that can be used to authenticate http requests using the given credentials.

Applies to

LoginByDeviceCodeAsync(String, String, ActiveDirectoryServiceSettings, Func<DeviceCodeResult,Boolean>)

Log in to azure active directory using device code authentication.

public static System.Threading.Tasks.Task<Microsoft.Rest.ServiceClientCredentials> LoginByDeviceCodeAsync (string clientId, string domain, Microsoft.Rest.Azure.Authentication.ActiveDirectoryServiceSettings serviceSettings, Func<Microsoft.IdentityModel.Clients.ActiveDirectory.DeviceCodeResult,bool> deviceCodeHandler);
static member LoginByDeviceCodeAsync : string * string * Microsoft.Rest.Azure.Authentication.ActiveDirectoryServiceSettings * Func<Microsoft.IdentityModel.Clients.ActiveDirectory.DeviceCodeResult, bool> -> System.Threading.Tasks.Task<Microsoft.Rest.ServiceClientCredentials>
Public Shared Function LoginByDeviceCodeAsync (clientId As String, domain As String, serviceSettings As ActiveDirectoryServiceSettings, deviceCodeHandler As Func(Of DeviceCodeResult, Boolean)) As Task(Of ServiceClientCredentials)

Parameters

clientId
System.String

The active directory client id for this application.

domain
System.String

The active directory domain or tenant id to authenticate with.

serviceSettings
ActiveDirectoryServiceSettings

The active directory service details, including authentication endpoints and the intended token audience.

deviceCodeHandler
System.Func<DeviceCodeResult,System.Boolean>

User provided callback to display device code request. if returns false no token will be acquired.

Returns

System.Threading.Tasks.Task<ServiceClientCredentials>

A ServiceClientCredentials object that can be used to authenticate http requests using the given credentials.

Applies to

LoginByDeviceCodeAsync(String, String, ActiveDirectoryServiceSettings, TokenCache, Func<DeviceCodeResult,Boolean>)

Log in to azure active directory using device code authentication.

public static System.Threading.Tasks.Task<Microsoft.Rest.ServiceClientCredentials> LoginByDeviceCodeAsync (string clientId, string domain, Microsoft.Rest.Azure.Authentication.ActiveDirectoryServiceSettings serviceSettings, Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache cache, Func<Microsoft.IdentityModel.Clients.ActiveDirectory.DeviceCodeResult,bool> deviceCodeHandler);
static member LoginByDeviceCodeAsync : string * string * Microsoft.Rest.Azure.Authentication.ActiveDirectoryServiceSettings * Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache * Func<Microsoft.IdentityModel.Clients.ActiveDirectory.DeviceCodeResult, bool> -> System.Threading.Tasks.Task<Microsoft.Rest.ServiceClientCredentials>
Public Shared Function LoginByDeviceCodeAsync (clientId As String, domain As String, serviceSettings As ActiveDirectoryServiceSettings, cache As TokenCache, deviceCodeHandler As Func(Of DeviceCodeResult, Boolean)) As Task(Of ServiceClientCredentials)

Parameters

clientId
System.String

The active directory client id for this application.

domain
System.String

The active directory domain or tenant id to authenticate with.

serviceSettings
ActiveDirectoryServiceSettings

The active directory service details, including authentication endpoints and the intended token audience.

cache
TokenCache

The token cache to target during authentication.

deviceCodeHandler
System.Func<DeviceCodeResult,System.Boolean>

User provided callback to display device code request. if returns false no token will be acquired.

Returns

System.Threading.Tasks.Task<ServiceClientCredentials>

A ServiceClientCredentials object that can be used to authenticate http requests using the given credentials.

Applies to