Skip to content

There should be specialized normalizers for E-Mails #6330

@MovGP0

Description

@MovGP0

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.

Metadata

Metadata

Assignees

Labels

DoneThis issue has been fixedarea-identityIncludes: Identity and providersbreaking-changeThis issue / pr will introduce a breaking change, when resolved / merged.enhancementThis issue represents an ask for new feature or an enhancement to an existing one

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions