aspnet / Identity

[Archived] ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
1.96k stars 870 forks source link

IdentityOptions.User.IdentityOptions.User.AllowedUserNameCharacters set to support a language not English, like Chinese? #1848

Closed Caizhenyu closed 6 years ago

Caizhenyu commented 6 years ago

How can i set AllowedUserNameCharacters to support Chinese? I need it to be UserName not Email.

blowdart commented 6 years ago

You'd specify all the allowed characters in the option you mention. But given the large amount of Chinese characters that's probably not going to work for you. Instead try your own UserValidator, using https://github.com/aspnet/Identity/blob/dev/src/Core/UserValidator.cs as a staring point

Caizhenyu commented 6 years ago

@blowdart ,thank you. But i will add a property Name in my User : IdentityUser.