Copied to clipboard

Flag this post as spam?

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


  • Ligia 15 posts 74 karma points
    Nov 05, 2014 @ 18:04
    Ligia
    0

    Why Member.GetMemberFromLoginNameAndPassword is obsolete in v6.2.4? How I can replace this functionality?

    Hello  Umbraco Community,

    I'm tring to authenticate a umbraco member and I have a problem, this call is always returning null. I used the same call in versions 6.1.1  and  7.1.6.  At the moment I have a project with version 6.2.4. 

    The bug U4-3741 (http://issues.umbraco.org/issue/U4-3741) wasn't included in this version. Are there any posibilities to do this functionality in an other way?

     

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Nov 05, 2014 @ 18:47
    Jan Skovgaard
    0

    Hi Ligia

    The member API was updated with the release of Umbraco 6.2, which is probably why the above method is obsolete now.

    But you should be able to use the new API here http://our.umbraco.org/documentation/Reference/Management-v6/Services/MemberService

    Hope this helps.

    /Jan

  • Ligia 15 posts 74 karma points
    Nov 06, 2014 @ 12:56
    Ligia
    0

    Hi Jan, 

    Thank you very much for you response, I also tried the memberservice but without luck. I succeded to do the authentication using a different method.  For those who have the same problem as me, please see the below solution:

    1. Take the password of the member identified by email adrdress ( var attemptLogin = Member.GetMemberFromEmail(model.EmailAddress).GetPassword();)

    2. Hash the password  using the class (this class is used to encrypt the password in umbraco membership provider )

    HMACSHA1 hash = new HMACSHA1();      

    hash.Key = Encoding.Unicode.GetBytes(password);

    string encodedPassword = Convert.ToBase64String(hash.ComputeHash(Encoding.Unicode.GetBytes(password)));

    3. Compare the two passwords 

  • Sören Deger 733 posts 2844 karma points c-trib
    Nov 06, 2014 @ 14:17
    Sören Deger
    1

    Hi Liqia,

    this is a simpler way to do this:

    MembershipHelper Members = new MembershipHelper(UmbracoContext.Current);

    if(Members.Login(username, password))
    {
       
    // do anything
    }  

     

    Sören

  • Ligia 15 posts 74 karma points
    Nov 11, 2014 @ 18:05
    Ligia
    0

    Hi Sören,

    Thank you very much for you answer. Sorry but in my case didn't work(I'm on version 6.2.4). Please can you specify the version you've used something similar?

    Many thanks, 

    Ligia

  • Sören Deger 733 posts 2844 karma points c-trib
    Nov 12, 2014 @ 08:46
    Sören Deger
    0

    Hi Liqia,

    I use this in 7.1.7 and it works.

     

    Sören

Please Sign in or register to post replies

Write your reply to:

Draft