Class LoginWithRecoveryCodeForm
Represents the second step of a sign-in when the user has no access to their authenticator app: one of the recovery codes issued when two-factor authentication was enabled.
public class LoginWithRecoveryCodeForm
- Inheritance
-
LoginWithRecoveryCodeForm
- Inherited Members
Remarks
Each recovery code works once. The user is identified by the sign-in in progress, never by this form.
Properties
RecoveryCode
Gets or sets the recovery code.
[Display(Name = "RecoveryCode", ResourceType = typeof(Fields))]
[Required(ErrorMessageResourceName = "XRequired", ErrorMessageResourceType = typeof(Messages))]
[MaxLength(20, ErrorMessageResourceName = "XMustHaveUpToYCharacters", ErrorMessageResourceType = typeof(Messages))]
public virtual string? RecoveryCode { get; set; }
Property Value
Remarks
ASP.NET Core Identity issues codes of eleven characters with a hyphen in the middle; the limit leaves room for surrounding spaces, which should be trimmed before verifying it.