When a user logs in with the default implementation of the membership service in an asp.net mvc project, they are logged in with a username with whatever case they used when logging in.
For example, if I create a user called John. If I then log in as joHN, then User.Identity.Name will equal joHN. I would like it to equal John, the actual user's login name.
At the moment I'm getting around this like so:
var membershipUser = Membership.GetUser(model.UserName);
var membershipUserName = Membership.GetUserNameByEmail(membershipUser .Email);
FormsService.SignIn(membershipUserName, model.RememberMe);
instead of the default implementation:
FormsService.SignIn(model.UserName, model.RememberMe);
It seems a bit circuitous, is there any better way to do this?