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
String

The active directory client id for this application.

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

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

Returns

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
String

The active directory client id for this application.

domain
String

The active directory domain or tenant id to authenticate with.

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

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

Returns

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
String

The active directory client id for this application.

domain
String

The active directory domain or tenant id to authenticate with.

cache
Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache

The token cache to target during authentication.

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

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

Returns

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
String

The active directory client id for this application.

domain
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
Func<Microsoft.IdentityModel.Clients.ActiveDirectory.DeviceCodeResult,Boolean>

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

Returns

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
String

The active directory client id for this application.

domain
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
Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache

The token cache to target during authentication.

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

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

Returns

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

Applies to