Freigeben über


PublicClientApplication.AcquireTokenAsync Method

Definition

Overloads

AcquireTokenAsync(IEnumerable<String>, String, Prompt, String, IEnumerable<String>, String, UIParent)
Obsolete.

Interactive request to acquire token for a given login, with the possibility of controlling the user experience, passing extra query parameters, providing extra scopes that the user can pre-consent to, and overriding the authority pre-configured in the application

AcquireTokenAsync(IEnumerable<String>, IAccount, Prompt, String, IEnumerable<String>, String, UIParent)
Obsolete.

Interactive request to acquire token for a given account, with the possibility of controlling the user experience, passing extra query parameters, providing extra scopes that the user can pre-consent to, and overriding the authority pre-configured in the application

AcquireTokenAsync(IEnumerable<String>, String, Prompt, String, IEnumerable<String>, String)
Obsolete.

Interactive request to acquire token for a given login, with the possibility of controlling the user experience, passing extra query parameters, providing extra scopes that the user can pre-consent to, and overriding the authority pre-configured in the application

AcquireTokenAsync(IEnumerable<String>, IAccount, Prompt, String, IEnumerable<String>, String)
Obsolete.

Interactive request to acquire token for a given account, with the possibility of controlling the user experience, passing extra query parameters, providing extra scopes that the user can pre-consent to, and overriding the authority pre-configured in the application

AcquireTokenAsync(IEnumerable<String>, String, Prompt, String, UIParent)
Obsolete.

Interactive request to acquire token for a login with control of the UI prompt and possibility of passing extra query parameters like additional claims

AcquireTokenAsync(IEnumerable<String>, IAccount, Prompt, String, UIParent)
Obsolete.

Interactive request to acquire token for an account with control of the UI prompt and possibility of passing extra query parameters like additional claims

AcquireTokenAsync(IEnumerable<String>, String, Prompt, String)
Obsolete.

Interactive request to acquire token for a login with control of the UI prompt and possibility of passing extra query parameters like additional claims

AcquireTokenAsync(IEnumerable<String>, IAccount, Prompt, String)
Obsolete.

Interactive request to acquire token for an account with control of the UI prompt and possibility of passing extra query parameters like additional claims

AcquireTokenAsync(IEnumerable<String>, String, UIParent)
Obsolete.

Interactive request to acquire token for the specified scopes. The interactive window will be parented to the specified window. The user will need to sign-in but an account will be proposed based on the loginHint

AcquireTokenAsync(IEnumerable<String>, IAccount, UIParent)
Obsolete.

Interactive request to acquire token for the specified scopes. The user will need to sign-in but an account will be proposed based on the provided account

AcquireTokenAsync(IEnumerable<String>, String)
Obsolete.

Interactive request to acquire token for the specified scopes. The user will need to sign-in but an account will be proposed based on the loginHint

AcquireTokenAsync(IEnumerable<String>, UIParent)
Obsolete.

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

AcquireTokenAsync(IEnumerable<String>, IAccount)
Obsolete.

Interactive request to acquire token for the specified scopes. The user will need to sign-in but an account will be proposed based on the provided account

AcquireTokenAsync(IEnumerable<String>)
Obsolete.

Interactive request to acquire token for the specified scopes. The user is required to select an account

AcquireTokenAsync(IEnumerable<String>, String, Prompt, String, IEnumerable<String>, String, UIParent)

Caution

Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes.

Interactive request to acquire token for a given login, with the possibility of controlling the user experience, passing extra query parameters, providing extra scopes that the user can pre-consent to, and overriding the authority pre-configured in the application

[System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ")]
public System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult> AcquireTokenAsync (System.Collections.Generic.IEnumerable<string> scopes, string loginHint, Microsoft.Identity.Client.Prompt prompt, string extraQueryParameters, System.Collections.Generic.IEnumerable<string> extraScopesToConsent, string authority, Microsoft.Identity.Client.UIParent parent);
[<System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ")>]
abstract member AcquireTokenAsync : seq<string> * string * Microsoft.Identity.Client.Prompt * string * seq<string> * string * Microsoft.Identity.Client.UIParent -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
override this.AcquireTokenAsync : seq<string> * string * Microsoft.Identity.Client.Prompt * string * seq<string> * string * Microsoft.Identity.Client.UIParent -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
Public Function AcquireTokenAsync (scopes As IEnumerable(Of String), loginHint As String, prompt As Prompt, extraQueryParameters As String, extraScopesToConsent As IEnumerable(Of String), authority As String, parent As UIParent) As Task(Of AuthenticationResult)

Parameters

scopes
IEnumerable<String>

Scopes requested to access a protected API

loginHint
String

Identifier of the user. Generally in UserPrincipalName (UPN) format, e.g. john.doe@contoso.com

prompt
Prompt

Designed interactive experience for the user.

extraQueryParameters
String

This parameter will be appended as is to the query string in the HTTP authentication request to the authority. This is expected to be a string of segments of the form key=value separated by an ampersand character. The parameter can be null.

extraScopesToConsent
IEnumerable<String>

scopes that you can request the end user to consent upfront, in addition to the scopes for the protected web API for which you want to acquire a security token.

authority
String

Specific authority for which the token is requested. Passing a different value than configured does not change the configured value

parent
UIParent

Object containing a reference to the parent window/activity. REQUIRED for Xamarin.Android only.

Returns

Authentication result containing a token for the requested scopes and account

Implements

Attributes

Applies to

AcquireTokenAsync(IEnumerable<String>, IAccount, Prompt, String, IEnumerable<String>, String, UIParent)

Caution

Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes.

Interactive request to acquire token for a given account, with the possibility of controlling the user experience, passing extra query parameters, providing extra scopes that the user can pre-consent to, and overriding the authority pre-configured in the application

[System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)]
public System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult> AcquireTokenAsync (System.Collections.Generic.IEnumerable<string> scopes, Microsoft.Identity.Client.IAccount account, Microsoft.Identity.Client.Prompt prompt, string extraQueryParameters, System.Collections.Generic.IEnumerable<string> extraScopesToConsent, string authority, Microsoft.Identity.Client.UIParent parent);
[<System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)>]
abstract member AcquireTokenAsync : seq<string> * Microsoft.Identity.Client.IAccount * Microsoft.Identity.Client.Prompt * string * seq<string> * string * Microsoft.Identity.Client.UIParent -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
override this.AcquireTokenAsync : seq<string> * Microsoft.Identity.Client.IAccount * Microsoft.Identity.Client.Prompt * string * seq<string> * string * Microsoft.Identity.Client.UIParent -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
Public Function AcquireTokenAsync (scopes As IEnumerable(Of String), account As IAccount, prompt As Prompt, extraQueryParameters As String, extraScopesToConsent As IEnumerable(Of String), authority As String, parent As UIParent) As Task(Of AuthenticationResult)

Parameters

scopes
IEnumerable<String>

Scopes requested to access a protected API

account
IAccount

Account to use for the interactive token acquisition. See IAccount for ways to get an account

prompt
Prompt

Designed interactive experience for the user.

extraQueryParameters
String

This parameter will be appended as is to the query string in the HTTP authentication request to the authority. This is expected to be a string of segments of the form key=value separated by an ampersand character. The parameter can be null.

extraScopesToConsent
IEnumerable<String>

scopes that you can request the end user to consent upfront, in addition to the scopes for the protected web API for which you want to acquire a security token.

authority
String

Specific authority for which the token is requested. Passing a different value than configured does not change the configured value

parent
UIParent

Object containing a reference to the parent window/activity. REQUIRED for Xamarin.Android only.

Returns

Authentication result containing a token for the requested scopes and account

Implements

Attributes

Applies to

AcquireTokenAsync(IEnumerable<String>, String, Prompt, String, IEnumerable<String>, String)

Caution

Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes.

Interactive request to acquire token for a given login, with the possibility of controlling the user experience, passing extra query parameters, providing extra scopes that the user can pre-consent to, and overriding the authority pre-configured in the application

[System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)]
public System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult> AcquireTokenAsync (System.Collections.Generic.IEnumerable<string> scopes, string loginHint, Microsoft.Identity.Client.Prompt prompt, string extraQueryParameters, System.Collections.Generic.IEnumerable<string> extraScopesToConsent, string authority);
[<System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)>]
abstract member AcquireTokenAsync : seq<string> * string * Microsoft.Identity.Client.Prompt * string * seq<string> * string -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
override this.AcquireTokenAsync : seq<string> * string * Microsoft.Identity.Client.Prompt * string * seq<string> * string -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
Public Function AcquireTokenAsync (scopes As IEnumerable(Of String), loginHint As String, prompt As Prompt, extraQueryParameters As String, extraScopesToConsent As IEnumerable(Of String), authority As String) As Task(Of AuthenticationResult)

Parameters

scopes
IEnumerable<String>

Scopes requested to access a protected API

loginHint
String

Identifier of the user. Generally in UserPrincipalName (UPN) format, e.g. john.doe@contoso.com

prompt
Prompt

Designed interactive experience for the user.

extraQueryParameters
String

This parameter will be appended as is to the query string in the HTTP authentication request to the authority. This is expected to be a string of segments of the form key=value separated by an ampersand character. The parameter can be null.

extraScopesToConsent
IEnumerable<String>

Scopes that you can request the end user to consent upfront, in addition to the scopes for the protected web API for which you want to acquire a security token.

authority
String

Specific authority for which the token is requested. Passing a different value than configured does not change the configured value

Returns

Authentication result containing a token for the requested scopes and account

Implements

Attributes

Applies to

AcquireTokenAsync(IEnumerable<String>, IAccount, Prompt, String, IEnumerable<String>, String)

Caution

Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes.

Interactive request to acquire token for a given account, with the possibility of controlling the user experience, passing extra query parameters, providing extra scopes that the user can pre-consent to, and overriding the authority pre-configured in the application

[System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)]
public System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult> AcquireTokenAsync (System.Collections.Generic.IEnumerable<string> scopes, Microsoft.Identity.Client.IAccount account, Microsoft.Identity.Client.Prompt prompt, string extraQueryParameters, System.Collections.Generic.IEnumerable<string> extraScopesToConsent, string authority);
[<System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)>]
abstract member AcquireTokenAsync : seq<string> * Microsoft.Identity.Client.IAccount * Microsoft.Identity.Client.Prompt * string * seq<string> * string -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
override this.AcquireTokenAsync : seq<string> * Microsoft.Identity.Client.IAccount * Microsoft.Identity.Client.Prompt * string * seq<string> * string -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
Public Function AcquireTokenAsync (scopes As IEnumerable(Of String), account As IAccount, prompt As Prompt, extraQueryParameters As String, extraScopesToConsent As IEnumerable(Of String), authority As String) As Task(Of AuthenticationResult)

Parameters

scopes
IEnumerable<String>

Scopes requested to access a protected API

account
IAccount

Account to use for the interactive token acquisition. See IAccount for ways to get an account

prompt
Prompt

Designed interactive experience for the user.

extraQueryParameters
String

This parameter will be appended as is to the query string in the HTTP authentication request to the authority. This is expected to be a string of segments of the form key=value separated by an ampersand character. The parameter can be null.

extraScopesToConsent
IEnumerable<String>

Scopes that you can request the end user to consent upfront, in addition to the scopes for the protected web API for which you want to acquire a security token.

authority
String

Specific authority for which the token is requested. Passing a different value than configured does not change the configured value

Returns

Authentication result containing a token for the requested scopes and account

Implements

Attributes

Applies to

AcquireTokenAsync(IEnumerable<String>, String, Prompt, String, UIParent)

Caution

Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes.

Interactive request to acquire token for a login with control of the UI prompt and possibility of passing extra query parameters like additional claims

[System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)]
public System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult> AcquireTokenAsync (System.Collections.Generic.IEnumerable<string> scopes, string loginHint, Microsoft.Identity.Client.Prompt prompt, string extraQueryParameters, Microsoft.Identity.Client.UIParent parent);
[<System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)>]
abstract member AcquireTokenAsync : seq<string> * string * Microsoft.Identity.Client.Prompt * string * Microsoft.Identity.Client.UIParent -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
override this.AcquireTokenAsync : seq<string> * string * Microsoft.Identity.Client.Prompt * string * Microsoft.Identity.Client.UIParent -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
Public Function AcquireTokenAsync (scopes As IEnumerable(Of String), loginHint As String, prompt As Prompt, extraQueryParameters As String, parent As UIParent) As Task(Of AuthenticationResult)

Parameters

scopes
IEnumerable<String>

Scopes requested to access a protected API

loginHint
String

Identifier of the user. Generally in UserPrincipalName (UPN) format, e.g. john.doe@contoso.com

prompt
Prompt

Designed interactive experience for the user.

extraQueryParameters
String

This parameter will be appended as is to the query string in the HTTP authentication request to the authority. This is expected to be a string of segments of the form key=value separated by an ampersand character. The parameter can be null.

parent
UIParent

Object containing a reference to the parent window/activity. REQUIRED for Xamarin.Android only.

Returns

Authentication result containing a token for the requested scopes and account

Implements

Attributes

Applies to

AcquireTokenAsync(IEnumerable<String>, IAccount, Prompt, String, UIParent)

Caution

Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes.

Interactive request to acquire token for an account with control of the UI prompt and possibility of passing extra query parameters like additional claims

[System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)]
public System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult> AcquireTokenAsync (System.Collections.Generic.IEnumerable<string> scopes, Microsoft.Identity.Client.IAccount account, Microsoft.Identity.Client.Prompt prompt, string extraQueryParameters, Microsoft.Identity.Client.UIParent parent);
[<System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)>]
abstract member AcquireTokenAsync : seq<string> * Microsoft.Identity.Client.IAccount * Microsoft.Identity.Client.Prompt * string * Microsoft.Identity.Client.UIParent -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
override this.AcquireTokenAsync : seq<string> * Microsoft.Identity.Client.IAccount * Microsoft.Identity.Client.Prompt * string * Microsoft.Identity.Client.UIParent -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
Public Function AcquireTokenAsync (scopes As IEnumerable(Of String), account As IAccount, prompt As Prompt, extraQueryParameters As String, parent As UIParent) As Task(Of AuthenticationResult)

Parameters

scopes
IEnumerable<String>

Scopes requested to access a protected API

account
IAccount

Account to use for the interactive token acquisition. See IAccount for ways to get an account

prompt
Prompt

Designed interactive experience for the user.

extraQueryParameters
String

This parameter will be appended as is to the query string in the HTTP authentication request to the authority. This is expected to be a string of segments of the form key=value separated by an ampersand character. The parameter can be null.

parent
UIParent

Object containing a reference to the parent window/activity. REQUIRED for Xamarin.Android only.

Returns

Authentication result containing a token for the requested scopes and account

Implements

Attributes

Applies to

AcquireTokenAsync(IEnumerable<String>, String, Prompt, String)

Caution

Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes.

Interactive request to acquire token for a login with control of the UI prompt and possibility of passing extra query parameters like additional claims

[System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)]
public System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult> AcquireTokenAsync (System.Collections.Generic.IEnumerable<string> scopes, string loginHint, Microsoft.Identity.Client.Prompt prompt, string extraQueryParameters);
[<System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)>]
abstract member AcquireTokenAsync : seq<string> * string * Microsoft.Identity.Client.Prompt * string -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
override this.AcquireTokenAsync : seq<string> * string * Microsoft.Identity.Client.Prompt * string -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
Public Function AcquireTokenAsync (scopes As IEnumerable(Of String), loginHint As String, prompt As Prompt, extraQueryParameters As String) As Task(Of AuthenticationResult)

Parameters

scopes
IEnumerable<String>

Scopes requested to access a protected API

loginHint
String

Identifier of the user. Generally in UserPrincipalName (UPN) format, e.g. john.doe@contoso.com

prompt
Prompt

Designed interactive experience for the user.

extraQueryParameters
String

This parameter will be appended as is to the query string in the HTTP authentication request to the authority. This is expected to be a string of segments of the form key=value separated by an ampersand character. The parameter can be null.

Returns

Authentication result containing a token for the requested scopes and account

Implements

Attributes

Applies to

AcquireTokenAsync(IEnumerable<String>, IAccount, Prompt, String)

Caution

Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes.

Interactive request to acquire token for an account with control of the UI prompt and possibility of passing extra query parameters like additional claims

[System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)]
public System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult> AcquireTokenAsync (System.Collections.Generic.IEnumerable<string> scopes, Microsoft.Identity.Client.IAccount account, Microsoft.Identity.Client.Prompt prompt, string extraQueryParameters);
[<System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)>]
abstract member AcquireTokenAsync : seq<string> * Microsoft.Identity.Client.IAccount * Microsoft.Identity.Client.Prompt * string -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
override this.AcquireTokenAsync : seq<string> * Microsoft.Identity.Client.IAccount * Microsoft.Identity.Client.Prompt * string -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
Public Function AcquireTokenAsync (scopes As IEnumerable(Of String), account As IAccount, prompt As Prompt, extraQueryParameters As String) As Task(Of AuthenticationResult)

Parameters

scopes
IEnumerable<String>

Scopes requested to access a protected API

account
IAccount

Account to use for the interactive token acquisition. See IAccount for ways to get an account

prompt
Prompt

Designed interactive experience for the user.

extraQueryParameters
String

This parameter will be appended as is to the query string in the HTTP authentication request to the authority. This is expected to be a string of segments of the form key=value separated by an ampersand character. The parameter can be null.

Returns

Authentication result containing a token for the requested scopes and account

Implements

Attributes

Applies to

AcquireTokenAsync(IEnumerable<String>, String, UIParent)

Caution

Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes.

Interactive request to acquire token for the specified scopes. The interactive window will be parented to the specified window. The user will need to sign-in but an account will be proposed based on the loginHint

[System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)]
public System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult> AcquireTokenAsync (System.Collections.Generic.IEnumerable<string> scopes, string loginHint, Microsoft.Identity.Client.UIParent parent);
[<System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)>]
abstract member AcquireTokenAsync : seq<string> * string * Microsoft.Identity.Client.UIParent -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
override this.AcquireTokenAsync : seq<string> * string * Microsoft.Identity.Client.UIParent -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
Public Function AcquireTokenAsync (scopes As IEnumerable(Of String), loginHint As String, parent As UIParent) As Task(Of AuthenticationResult)

Parameters

scopes
IEnumerable<String>

Scopes requested to access a protected API

loginHint
String

Identifier of the user. Generally in UserPrincipalName (UPN) format, e.g. john.doe@contoso.com

parent
UIParent

Object containing a reference to the parent window/activity. REQUIRED for Xamarin.Android only.

Returns

Authentication result containing a token for the requested scopes and login

Implements

Attributes

Applies to

AcquireTokenAsync(IEnumerable<String>, IAccount, UIParent)

Caution

Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes.

Interactive request to acquire token for the specified scopes. The user will need to sign-in but an account will be proposed based on the provided account

[System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)]
public System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult> AcquireTokenAsync (System.Collections.Generic.IEnumerable<string> scopes, Microsoft.Identity.Client.IAccount account, Microsoft.Identity.Client.UIParent parent);
[<System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)>]
abstract member AcquireTokenAsync : seq<string> * Microsoft.Identity.Client.IAccount * Microsoft.Identity.Client.UIParent -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
override this.AcquireTokenAsync : seq<string> * Microsoft.Identity.Client.IAccount * Microsoft.Identity.Client.UIParent -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
Public Function AcquireTokenAsync (scopes As IEnumerable(Of String), account As IAccount, parent As UIParent) As Task(Of AuthenticationResult)

Parameters

scopes
IEnumerable<String>

Scopes requested to access a protected API

account
IAccount

Account to use for the interactive token acquisition. See IAccount for ways to get an account

parent
UIParent

Object containing a reference to the parent window/activity. REQUIRED for Xamarin.Android only.

Returns

Authentication result containing a token for the requested scopes and account

Implements

Attributes

Applies to

AcquireTokenAsync(IEnumerable<String>, String)

Caution

Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes.

Interactive request to acquire token for the specified scopes. The user will need to sign-in but an account will be proposed based on the loginHint

[System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)]
public System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult> AcquireTokenAsync (System.Collections.Generic.IEnumerable<string> scopes, string loginHint);
[<System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)>]
abstract member AcquireTokenAsync : seq<string> * string -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
override this.AcquireTokenAsync : seq<string> * string -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
Public Function AcquireTokenAsync (scopes As IEnumerable(Of String), loginHint As String) As Task(Of AuthenticationResult)

Parameters

scopes
IEnumerable<String>

Scopes requested to access a protected API

loginHint
String

Identifier of the user. Generally in UserPrincipalName (UPN) format, e.g. john.doe@contoso.com

Returns

Authentication result containing a token for the requested scopes and account

Implements

Attributes

Applies to

AcquireTokenAsync(IEnumerable<String>, UIParent)

Caution

Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes.

Interactive request to acquire 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.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)]
public System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult> AcquireTokenAsync (System.Collections.Generic.IEnumerable<string> scopes, Microsoft.Identity.Client.UIParent parent);
[<System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)>]
abstract member AcquireTokenAsync : seq<string> * Microsoft.Identity.Client.UIParent -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
override this.AcquireTokenAsync : seq<string> * Microsoft.Identity.Client.UIParent -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
Public Function AcquireTokenAsync (scopes As IEnumerable(Of String), parent As UIParent) As Task(Of AuthenticationResult)

Parameters

scopes
IEnumerable<String>

Scopes requested to access a protected API

parent
UIParent

Object containing a reference to the parent window/activity. REQUIRED for Xamarin.Android only.

Returns

Authentication result containing a token for the requested scopes and account

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.

Applies to

AcquireTokenAsync(IEnumerable<String>, IAccount)

Caution

Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes.

Interactive request to acquire token for the specified scopes. The user will need to sign-in but an account will be proposed based on the provided account

[System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)]
public System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult> AcquireTokenAsync (System.Collections.Generic.IEnumerable<string> scopes, Microsoft.Identity.Client.IAccount account);
[<System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)>]
abstract member AcquireTokenAsync : seq<string> * Microsoft.Identity.Client.IAccount -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
override this.AcquireTokenAsync : seq<string> * Microsoft.Identity.Client.IAccount -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
Public Function AcquireTokenAsync (scopes As IEnumerable(Of String), account As IAccount) As Task(Of AuthenticationResult)

Parameters

scopes
IEnumerable<String>

Scopes requested to access a protected API

account
IAccount

Account to use for the interactive token acquisition. See IAccount for ways to get an account

Returns

Authentication result containing a token for the requested scopes and account

Implements

Attributes

Applies to

AcquireTokenAsync(IEnumerable<String>)

Caution

Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes.

Interactive request to acquire token for the specified scopes. The user is required to select an account

[System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)]
public System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult> AcquireTokenAsync (System.Collections.Generic.IEnumerable<string> scopes);
[<System.Obsolete("Use AcquireTokenInteractive instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)>]
abstract member AcquireTokenAsync : seq<string> -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
override this.AcquireTokenAsync : seq<string> -> System.Threading.Tasks.Task<Microsoft.Identity.Client.AuthenticationResult>
Public Function AcquireTokenAsync (scopes As IEnumerable(Of String)) As Task(Of AuthenticationResult)

Parameters

scopes
IEnumerable<String>

Scopes requested to access a protected API

Returns

Authentication result containing a token for the requested scopes and account

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.

Applies to