SignInManager<TUser>.SignInOrTwoFactorAsync 方法

定义

如果 bypassTwoFactor 设置为 false,则登录指定的 user 。 否则,user将 存储在双因素检查之后使用。

protected virtual System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.SignInResult> SignInOrTwoFactorAsync (TUser user, bool isPersistent, string loginProvider = default, bool bypassTwoFactor = false);
protected virtual System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.SignInResult> SignInOrTwoFactorAsync (TUser user, bool isPersistent, string? loginProvider = default, bool bypassTwoFactor = false);
abstract member SignInOrTwoFactorAsync : 'User * bool * string * bool -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.SignInResult>
override this.SignInOrTwoFactorAsync : 'User * bool * string * bool -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.SignInResult>
Protected Overridable Function SignInOrTwoFactorAsync (user As TUser, isPersistent As Boolean, Optional loginProvider As String = Nothing, Optional bypassTwoFactor As Boolean = false) As Task(Of SignInResult)

参数

user
TUser
isPersistent
Boolean

指示登录 Cookie 在浏览器关闭后是否应保留的标志。

loginProvider
String

要使用的登录提供程序。 默认值为 null

bypassTwoFactor
Boolean

指示是否绕过双重身份验证的标志。 默认值为 false

返回

返回一个 SignInResult

适用于