IPublicClientApplication.AcquireTokenByUsernamePassword 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.
Overloads
AcquireTokenByUsernamePassword(IEnumerable<String>, String, SecureString) |
Obsolete.
Non-interactive request to acquire a token via username and password authentication. |
AcquireTokenByUsernamePassword(IEnumerable<String>, String, String) |
Obsolete.
Acquires a token without user interaction using username and password authentication. This method does not look in the token cache, but stores the result in it. Before calling this method, use other methods such as AcquireTokenSilent(IEnumerable<String>, IAccount) to check the token cache. |
AcquireTokenByUsernamePassword(IEnumerable<String>, String, SecureString)
Caution
This API has been deprecated, use a more secure flow. See https://aka.ms/msal-ropc-migration for migration guidance
Non-interactive request to acquire a token via username and password authentication.
[System.Obsolete("This API has been deprecated, use a more secure flow. See https://aka.ms/msal-ropc-migration for migration guidance", false)]
public Microsoft.Identity.Client.AcquireTokenByUsernamePasswordParameterBuilder AcquireTokenByUsernamePassword(System.Collections.Generic.IEnumerable<string> scopes, string username, System.Security.SecureString password);
[<System.Obsolete("This API has been deprecated, use a more secure flow. See https://aka.ms/msal-ropc-migration for migration guidance", false)>]
abstract member AcquireTokenByUsernamePassword : seq<string> * string * System.Security.SecureString -> Microsoft.Identity.Client.AcquireTokenByUsernamePasswordParameterBuilder
Public Function AcquireTokenByUsernamePassword (scopes As IEnumerable(Of String), username As String, password As SecureString) As AcquireTokenByUsernamePasswordParameterBuilder
Parameters
- scopes
- IEnumerable<String>
Scopes requested to access a protected API
- username
- String
Identifier of the user application requests token on behalf.
Generally in UserPrincipalName (UPN) format, e.g. [email protected]
- password
- SecureString
User password as a secure string.
Returns
A builder enabling you to add optional parameters before executing the token request
- Attributes
Remarks
Available only for .NET Framework and .NET Core applications. See our documentation for details. .NET no longer recommends using SecureString and MSAL puts the plaintext value of the password on the wire, as required by the OAuth protocol. See SecureString documentation for details.
Applies to
AcquireTokenByUsernamePassword(IEnumerable<String>, String, String)
Caution
This API has been deprecated, use a more secure flow. See https://aka.ms/msal-ropc-migration for migration guidance
Acquires a token without user interaction using username and password authentication. This method does not look in the token cache, but stores the result in it. Before calling this method, use other methods such as AcquireTokenSilent(IEnumerable<String>, IAccount) to check the token cache.
[System.Obsolete("This API has been deprecated, use a more secure flow. See https://aka.ms/msal-ropc-migration for migration guidance", false)]
public Microsoft.Identity.Client.AcquireTokenByUsernamePasswordParameterBuilder AcquireTokenByUsernamePassword(System.Collections.Generic.IEnumerable<string> scopes, string username, string password);
[<System.Obsolete("This API has been deprecated, use a more secure flow. See https://aka.ms/msal-ropc-migration for migration guidance", false)>]
abstract member AcquireTokenByUsernamePassword : seq<string> * string * string -> Microsoft.Identity.Client.AcquireTokenByUsernamePasswordParameterBuilder
Public Function AcquireTokenByUsernamePassword (scopes As IEnumerable(Of String), username As String, password As String) As AcquireTokenByUsernamePasswordParameterBuilder
Parameters
- scopes
- IEnumerable<String>
Scopes requested to access a protected API.
- username
- String
Identifier of the user application requests token on behalf.
Generally in UserPrincipalName (UPN) format, e.g. [email protected]
- password
- String
User password as a string.
Returns
A builder enabling you to add optional parameters before executing the token request.
- Attributes
Remarks
Available only for .NET Framework and .NET Core applications. See our documentation for details.