Udostępnij za pośrednictwem


PublicClientApplication.AcquireTokenInteractive Method

Definition

Important

This API is not CLS-compliant.

Interactive request to acquire a token for the specified scopes. The interactive window will be parented to the specified window. The user will be required to select an account.

[System.CLSCompliant(false)]
public Microsoft.Identity.Client.AcquireTokenInteractiveParameterBuilder AcquireTokenInteractive (System.Collections.Generic.IEnumerable<string> scopes);
[<System.CLSCompliant(false)>]
abstract member AcquireTokenInteractive : seq<string> -> Microsoft.Identity.Client.AcquireTokenInteractiveParameterBuilder
override this.AcquireTokenInteractive : seq<string> -> Microsoft.Identity.Client.AcquireTokenInteractiveParameterBuilder
Public Function AcquireTokenInteractive (scopes As IEnumerable(Of String)) As AcquireTokenInteractiveParameterBuilder

Parameters

scopes
IEnumerable<String>

Scopes requested to access a protected API

Returns

A builder enabling you to add optional parameters before executing the token request

Implements

Attributes

Remarks

The user will be signed-in interactively if needed, and will consent to scopes and do multi-factor authentication if such a policy was enabled in the Azure AD tenant.

You can also pass optional parameters by calling:

WithPrompt(Prompt) to specify the user experience when signing-in, WithUseEmbeddedWebView(Boolean) to specify if you want to use the embedded web browser or the system default browser, WithSystemWebViewOptions(SystemWebViewOptions) to configure the user experience when using the Default browser, WithAccount(IAccount) or WithLoginHint(String) to prevent the select account dialog from appearing in the case you want to sign-in a specific account, WithExtraScopesToConsent(IEnumerable<String>) if you want to let the user pre-consent to additional scopes (which won't be returned in the access token), Microsoft.Identity.Client.AbstractAcquireTokenParameterBuilder`1.WithExtraQueryParameters(System.Collections.Generic.Dictionary{System.String,System.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