Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ulf Möllerström 71 posts 248 karma points
    Nov 08, 2016 @ 13:02
    Ulf Möllerström
    0

    ASP.NET membership provider is not case-sensitive

    Hi all!

    Searched around, but couldn't find any post about that the ASP.NET Membership Provider isn't case-sensitive, but that Umbraco are, when looking up the authenticated user.

    So...

    var member = memberService.GetAllMembers().FirstOrDefault(m => m.Username == User.Identity.Name);
    

    Results in an authenticated user, but no Umbraco member, if the member supplies the user-name in incorrect case, i.e. John.Smith@123.com instead of john.smith@123.com.

    The fix is simple enough, just modify this in the controller.

    Membership.ValidateUser(model.Login.ToLower(), model.Password)
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies