Skip to content

Instantly share code, notes, and snippets.

@pollax
Last active February 28, 2016 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pollax/4449ce7cf47bde6b3a95 to your computer and use it in GitHub Desktop.
Save pollax/4449ce7cf47bde6b3a95 to your computer and use it in GitHub Desktop.
Allow + and other non alphanumeric characters in UserName using ASP.NET Core 1.0, Identity 3.0 and Entity Framework Core 1.0
public void ConfigureServices(IServiceCollection services)
{
// (Rest of code removed)
// Note the + added to the string of allowed user name characters
services.AddIdentity<ApplicationUser, IdentityRole>(o => o.User.AllowedUserNameCharacters = @"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 -._@+")
.AddEntityFrameworkStores<ApplicationDbContext>()
.AddDefaultTokenProviders();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment