Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

SignInManager<TUser>.PasswordSignInAsync Method

Definition

Namespace:
Microsoft.AspNetCore.Identity
Assembly:
Microsoft.AspNetCore.Identity.dll
Package:
Microsoft.AspNetCore.Identity v1.0.0
Package:
Microsoft.AspNetCore.Identity v1.1.0
Package:
Microsoft.AspNetCore.App.Ref v10.0.0
Package:
Microsoft.AspNetCore.App.Ref v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore.Identity v2.0.0
Package:
Microsoft.AspNetCore.Identity v2.1.0
Package:
Microsoft.AspNetCore.Identity v2.2.0
Package:
Microsoft.AspNetCore.App.Ref v3.0.1
Package:
Microsoft.AspNetCore.App.Ref v3.1.10
Package:
Microsoft.AspNetCore.App.Ref v5.0.0
Package:
Microsoft.AspNetCore.App.Ref v6.0.36
Package:
Microsoft.AspNetCore.App.Ref v7.0.5
Package:
Microsoft.AspNetCore.App.Ref v8.0.19
Package:
Microsoft.AspNetCore.App.Ref v9.0.8

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

Name Description
PasswordSignInAsync(String, String, Boolean, Boolean)

Attempts to sign in the specified userName and password combination as an asynchronous operation.

PasswordSignInAsync(TUser, String, Boolean, Boolean)

Attempts to sign in the specified user and password combination as an asynchronous operation.

PasswordSignInAsync(String, String, Boolean, Boolean)

Source:
SignInManager.cs
Source:
SignInManager.cs
Source:
SignInManager.cs

Attempts to sign in the specified userName and password combination as an asynchronous operation.

public:
 virtual System::Threading::Tasks::Task<Microsoft::AspNetCore::Identity::SignInResult ^> ^ PasswordSignInAsync(System::String ^ userName, System::String ^ password, bool isPersistent, bool lockoutOnFailure);
public virtual System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.SignInResult> PasswordSignInAsync(string userName, string password, bool isPersistent, bool lockoutOnFailure);
abstract member PasswordSignInAsync : string * string * bool * bool -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.SignInResult>
override this.PasswordSignInAsync : string * string * bool * bool -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.SignInResult>
Public Overridable Function PasswordSignInAsync (userName As String, password As String, isPersistent As Boolean, lockoutOnFailure As Boolean) As Task(Of SignInResult)

Parameters

userName
String

The user name to sign in.

password
String

The password to attempt to sign in with.

isPersistent
Boolean

Flag indicating whether the sign-in cookie should persist after the browser is closed.

lockoutOnFailure
Boolean

Flag indicating if the user account should be locked if the sign in fails.

Returns

The task object representing the asynchronous operation containing the SignInResult for the sign-in attempt.

Applies to

PasswordSignInAsync(TUser, String, Boolean, Boolean)

Source:
SignInManager.cs
Source:
SignInManager.cs
Source:
SignInManager.cs

Attempts to sign in the specified user and password combination as an asynchronous operation.

public:
 virtual System::Threading::Tasks::Task<Microsoft::AspNetCore::Identity::SignInResult ^> ^ PasswordSignInAsync(TUser user, System::String ^ password, bool isPersistent, bool lockoutOnFailure);
public virtual System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.SignInResult> PasswordSignInAsync(TUser user, string password, bool isPersistent, bool lockoutOnFailure);
abstract member PasswordSignInAsync : 'User * string * bool * bool -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.SignInResult>
override this.PasswordSignInAsync : 'User * string * bool * bool -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.SignInResult>
Public Overridable Function PasswordSignInAsync (user As TUser, password As String, isPersistent As Boolean, lockoutOnFailure As Boolean) As Task(Of SignInResult)

Parameters

user
TUser

The user to sign in.

password
String

The password to attempt to sign in with.

isPersistent
Boolean

Flag indicating whether the sign-in cookie should persist after the browser is closed.

lockoutOnFailure
Boolean

Flag indicating if the user account should be locked if the sign in fails.

Returns

The task object representing the asynchronous operation containing the SignInResult for the sign-in attempt.

Applies to


Feedback

Was this page helpful?