Issue with password reset for usernames having hyphen

Rajani Radhakrishnan asked on August 15, 2019 17:04

Hi, The GeneratePasswordResetAsync function is not working for users who have a hyphen in their username(which is their email address itself) for our kentico application. I tried reading this and adding this key to config file for our application ,but didn't work: https://devnet.kentico.com/articles/allowing-unicode-characters-in-username

I believe what we are looking for is something along the lines of what is mentioned in this stackoverflow URL, but that is applying the UserValidator on the ASPNET UserManager, we need to apply it on the Kentico Membership UserManager, but we are not able to figure out exactly how to do that. https://stackoverflow.com/questions/19459591/allowonlyalphanumericusernames-how-to-set-it-rc-to-rtm-breaking-change-asp

Can someone help with this?

Recent Answers


vasu yerramsetti answered on August 19, 2019 10:48

@Rajani Radhakrishnan - What is your Kentico version? Exactly, where you are facing this issue (Portal Engine Or MVC).

0 votesVote for this answer Mark as a Correct answer

Eric Dugre answered on September 18, 2019 15:58

Rajani,

It looks like you can alter the UserValidator at any point, e.g. within a Controller as suggested here: https://stackoverflow.com/questions/19460078/configure-microsoft-aspnet-identity-to-allow-email-address-as-username/19460800#19460800. But, you could probably also add this code to your Startup.Auth.cs file which initializes OWIN.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.