-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Description
Is your feature request related to a problem? Please describe.
Given I have an E-Mail address that includes unicode characters. When its normalized in the database using the UpperInvariantLookupNormalizer, those unicode characters are not properly escaped into Punycode using the System.Globalization.IdnMapping class.
When registering a custom normalizer, it will apply to email addresses and user names, even in use cases when the user name is not an email address.
Describe the solution you'd like
I propose to have specialized versions of ILookupNormalizer for e-mail addresses and user names:
public interface IUserNameLookupNormalizer : ILookupNormalizer {}
public interface IEmailLookupNormalizer : ILookupNormalizer {}as well as appropriate default implementations that remove diacritic symbols, or escape punycode respectively.
Describe alternatives you've considered
The current workaround is to implement custom IUserEmailStore<TUser>, UserManager<User>, and RoleManager<Role> derived classes and overwrite the methods which use the normalized username or the normalized email address. One can that implement the interfaces above and provide the normalizers using Dependency Injection.