Class LoginWithTwoFactorForm
Represents the second step of a sign-in: the code from the user's authenticator app.
public class LoginWithTwoFactorForm
- Inheritance
-
LoginWithTwoFactorForm
- Inherited Members
Remarks
Used after the password has been accepted for a user with two-factor authentication enabled. The user is identified by the sign-in in progress, never by this form.
Properties
Code
Gets or sets the code shown by the authenticator app.
[Display(Name = "VerificationCode", ResourceType = typeof(Fields))]
[Required(ErrorMessageResourceName = "XRequired", ErrorMessageResourceType = typeof(Messages))]
[MinLength(6, ErrorMessageResourceName = "XMustHaveAtLeastYCharacters", ErrorMessageResourceType = typeof(Messages))]
[MaxLength(7, ErrorMessageResourceName = "XMustHaveUpToYCharacters", ErrorMessageResourceType = typeof(Messages))]
public virtual string? Code { get; set; }
Property Value
Remarks
Six digits. Up to seven characters are accepted so a code typed with a space in the middle, as most authenticator apps display it, still passes; strip spaces and hyphens before verifying it.
RememberDevice
Gets or sets a value indicating whether this browser should skip the second step on later sign-ins.
[Display(Name = "RememberThisDeviceQuestion", ResourceType = typeof(Fields))]
public virtual bool RememberDevice { get; set; }