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 70 posts 247 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. [email protected] instead of [email protected].

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

    Membership.ValidateUser(model.Login.ToLower(), model.Password)
    
Please Sign in or register to post replies

Write your reply to:

Draft