PublicClientApplication.AcquireTokenWithDeviceCode Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Acquires a security token on a device without a web browser, by letting the user authenticate on another device. This is done in two steps:
- The method first acquires a device code from the authority and returns it to the caller via
the
deviceCodeResultCallback
. This callback takes care of interacting with the user to direct them to authenticate (to a specific URL, with a code) - The method then proceeds to poll for the security token which is granted upon successful login by the user based on the device code information
public Microsoft.Identity.Client.AcquireTokenWithDeviceCodeParameterBuilder AcquireTokenWithDeviceCode (System.Collections.Generic.IEnumerable<string> scopes, Func<Microsoft.Identity.Client.DeviceCodeResult,System.Threading.Tasks.Task> deviceCodeResultCallback);
abstract member AcquireTokenWithDeviceCode : seq<string> * Func<Microsoft.Identity.Client.DeviceCodeResult, System.Threading.Tasks.Task> -> Microsoft.Identity.Client.AcquireTokenWithDeviceCodeParameterBuilder
override this.AcquireTokenWithDeviceCode : seq<string> * Func<Microsoft.Identity.Client.DeviceCodeResult, System.Threading.Tasks.Task> -> Microsoft.Identity.Client.AcquireTokenWithDeviceCodeParameterBuilder
Public Function AcquireTokenWithDeviceCode (scopes As IEnumerable(Of String), deviceCodeResultCallback As Func(Of DeviceCodeResult, Task)) As AcquireTokenWithDeviceCodeParameterBuilder
Parameters
- scopes
- IEnumerable<String>
Scopes requested to access a protected API
- deviceCodeResultCallback
- Func<DeviceCodeResult,Task>
Callback containing information to show the user about how to authenticate and enter the device code.
Returns
A builder enabling you to add optional parameters before executing the token request
Implements
Remarks
You can also pass optional parameters by calling: WithExtraQueryParameters(Dictionary<String,String>) to pass additional query parameters to the STS, and one of the overrides of WithAuthority(String, Boolean) in order to override the default authority set at the application construction. Note that the overriding authority needs to be part of the known authorities added to the application construction.
Applies to
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示