共用方式為


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

適用於