title: Unconfirmed Email Login: PasswordSignInAsync Returning 'NotAllowed' Result Despite 'options.SignIn.RequireConfirmedEmail = false;'
body: <p>I've created a Razor Pages Web App targeting .NET 5.0. No authentication was selected on creation, and ASP.NET Identity was added to the project as a scaffolded item immediately after creation, with all Identity files being overridden. </p>
  <p>While experimenting with the ASP.NET Identity options, I set 'options.SignIn.RequireConfirmedEmail = false;' in the ConfigureServices method of the Startup.cs class file as <a href="https://i.stack.imgur.com/81NZJ.png" rel="nofollow noreferrer">shown here</a>.</p>
  <p>Despite options.SignIn.RequireConfirmedEmail being set to false, I was still unable to login using an unconfirmed email, with the catch-all error message of &quot;Invalid login attempt.&quot; appearing above the form.</p>
  <p>Setting a breakpoint, I found that, during login, the result variable receives a &quot;NotAllowed&quot; value from the _signInManager.PasswordSignInAsync() method.</p>
  <p><a href="https://i.stack.imgur.com/GJf2F.png" rel="nofollow noreferrer">Image of Breakpoint in OnPostAsync Method in Login.cshtml.cs</a></p>
  <p><a href="https://i.stack.imgur.com/7xohd.png" rel="nofollow noreferrer">Image of Local Variables Immediately After Calling _signInManager.PasswordSignInAsync()</a></p>
  <p>Upon setting the email to be confirmed, the login succeeds. Therefore, the only difference between login success and failure is whether or not the email is confirmed, even though options.SignIn.RequireConfirmedEmail has been set to false in the ConfigureServices method of the Startup.cs class file.</p>
  <p>The question then is, have I missed something that is required to allow for an unconfirmed email to successfully login? If not, then is this a bug? Also, how could one allow for an unconfirmed email to successfully login, assuming that options.SignIn.RequireConfirmedEmail blocks unconfirmed email login attempts regardless of whether it has been set to true or false?</p>
  <p>Thank you very much.</p>