Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

What I'm trying to do is simply allow alphanumeric characters in the .NET MVC 6 / vNext registration process and every tutorial I've seen (ie Configure Microsoft.AspNet.Identity to allow email address as usernameConfigure Microsoft.AspNet.Identity to allow email address as username) references UserManager.UserValidator, in which is now not available in the current framework.

I've seen this: UserValidator in Microsoft.AspNet.Identity vnextUserValidator in Microsoft.AspNet.Identity vnext which looks to be the same issue as mine, but they've taken the UserNameValidationRegex property out of the framework since. Brilliant.

services.AddIdentity<ApplicationUser, IdentityRole>( o => { o.Password.RequireDigit = false; o.Password.RequireLowercase = false; o.Password.RequireUppercase = false; o.Password.RequireNonLetterOrDigit = false; o.Password.RequiredLength = 2; //o.User.AllowedUserNameCharacters here seems to be the only logical thing I can access }) .AddEntityFrameworkStores<ApplicationDbContext>() .AddDefaultTokenProviders(); 

I've found o.User.AllowedUserNameCharacters, but with there being no documentation that I've found on this I've no idea what format I have to set that in? Anyone out there that's in the same boat and worked this out?

Thanks in advance.

What I'm trying to do is simply allow alphanumeric characters in the .NET MVC 6 / vNext registration process and every tutorial I've seen (ie Configure Microsoft.AspNet.Identity to allow email address as username) references UserManager.UserValidator, in which is now not available in the current framework.

I've seen this: UserValidator in Microsoft.AspNet.Identity vnext which looks to be the same issue as mine, but they've taken the UserNameValidationRegex property out of the framework since. Brilliant.

services.AddIdentity<ApplicationUser, IdentityRole>( o => { o.Password.RequireDigit = false; o.Password.RequireLowercase = false; o.Password.RequireUppercase = false; o.Password.RequireNonLetterOrDigit = false; o.Password.RequiredLength = 2; //o.User.AllowedUserNameCharacters here seems to be the only logical thing I can access }) .AddEntityFrameworkStores<ApplicationDbContext>() .AddDefaultTokenProviders(); 

I've found o.User.AllowedUserNameCharacters, but with there being no documentation that I've found on this I've no idea what format I have to set that in? Anyone out there that's in the same boat and worked this out?

Thanks in advance.

What I'm trying to do is simply allow alphanumeric characters in the .NET MVC 6 / vNext registration process and every tutorial I've seen (ie Configure Microsoft.AspNet.Identity to allow email address as username) references UserManager.UserValidator, in which is now not available in the current framework.

I've seen this: UserValidator in Microsoft.AspNet.Identity vnext which looks to be the same issue as mine, but they've taken the UserNameValidationRegex property out of the framework since. Brilliant.

services.AddIdentity<ApplicationUser, IdentityRole>( o => { o.Password.RequireDigit = false; o.Password.RequireLowercase = false; o.Password.RequireUppercase = false; o.Password.RequireNonLetterOrDigit = false; o.Password.RequiredLength = 2; //o.User.AllowedUserNameCharacters here seems to be the only logical thing I can access }) .AddEntityFrameworkStores<ApplicationDbContext>() .AddDefaultTokenProviders(); 

I've found o.User.AllowedUserNameCharacters, but with there being no documentation that I've found on this I've no idea what format I have to set that in? Anyone out there that's in the same boat and worked this out?

Thanks in advance.

edited title
Link
Chris Dixon
  • 9.2k
  • 7
  • 38
  • 69

.NET MVC 6 / vNext UserValidator to allow alphanumeric characters

edited tags
Link
Chris Dixon
  • 9.2k
  • 7
  • 38
  • 69
Source Link
Chris Dixon
  • 9.2k
  • 7
  • 38
  • 69
Loading