AuthenticationContext.AcquireTokenByDeviceCodeAsync(DeviceCodeResult) Method

Definition

Acquires security token from the authority using an device code previously received. This method does not lookup token cache, but stores the result in it, so it can be looked up using other methods such as AcquireTokenSilentAsync(String, String, UserIdentifier).

public System.Threading.Tasks.Task<Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResult> AcquireTokenByDeviceCodeAsync (Microsoft.IdentityModel.Clients.ActiveDirectory.DeviceCodeResult deviceCodeResult);
member this.AcquireTokenByDeviceCodeAsync : Microsoft.IdentityModel.Clients.ActiveDirectory.DeviceCodeResult -> System.Threading.Tasks.Task<Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResult>

Parameters

deviceCodeResult
DeviceCodeResult

The device code result received from calling AcquireDeviceCodeAsync.

Returns

System.Threading.Tasks.Task<AuthenticationResult>

It contains Access Token, its expiration time, user information.

Applies to