title: Microsoft.AspNetCore.Identity.IdentityError: "InvalidUserName"
body: <p>I did default Megration with User model, added only my two custom properties. EF created standard flow of tables.</p>
  <p><a href="https://i.stack.imgur.com/aONt0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aONt0.png" alt="enter image description here" /></a></p>
  <p>And my AspNetUsers table</p>
  <p><a href="https://i.stack.imgur.com/XB2XM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XB2XM.png" alt="enter image description here" /></a></p>
  <p>As you can see UserName can be null.</p>
  <p>My User Model</p>
  <pre><code>public class User : IdentityUser
  {
      public string FullName { get; set; }
      public string CreateAt { get; set; }
      public User()
      {
          this.CreateAt = Convert.ToString(DateTime.Now);
      }
  }
  </code></pre>
  <p>And when I create user, I have exeption</p>
  <p><a href="https://i.stack.imgur.com/vy7Ua.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vy7Ua.png" alt="enter image description here" /></a></p>
  <p>But I didnt make any validation or rules for UserName.
  My startup configuration for ApplicationDBContext</p>
  <pre><code>services.AddIdentityCore&lt;User&gt;(opts =&gt;
          {
              opts.Password.RequiredLength = 5;
              opts.Password.RequireNonAlphanumeric = false;
              opts.Password.RequireLowercase = true;
              opts.Password.RequireUppercase = true;
              opts.Password.RequireDigit = true; 
              opts.User.AllowedUserNameCharacters = null;
          }).AddRoles&lt;IdentityRole&gt;()
          .AddEntityFrameworkStores&lt;ApplicationDBContext&gt;()
          .AddDefaultTokenProviders();
  </code></pre>
  <p><code>opts.User.AllowedUserNameCharacters = null;</code> Didn't help me. What I do wrong?</p>