How to GetPassword in sitefinity Membership API

4 posts, 0 answers
  1. Waji
    Waji avatar
    2 posts
    Member since:
    Jun 2011

    Posted 14 Jun 2011 Link to this post

    Hello,

    I have a issue like if I want to get password for registered user so it give me null reference error also I set machine key in web.config.

    can any one know how I solved this issue.

    Thanks
  2. Ivan Dimitrov
    Admin
    Ivan Dimitrov avatar
    78 posts

    Posted 14 Jun 2011 Link to this post

    Hi Waji,

    Could you send the code that you use to get the password and what is the passwordFormat you use? If you use hashed password format you cannot get the users' password unless you have encryption and decryption algorithms which of course are private in our provider due to security reasons.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  3. Waji
    Waji avatar
    2 posts
    Member since:
    Jun 2011

    Posted 14 Jun 2011 Link to this post

    Hello
    Thanks for reply.
    MembershipUser userObj=Membership.GetUser(LoginName);
    Password = userObj.GetPassword();


    <machineKey validationKey="1E7B21306A7B8D73CBB2507C9632552CD34BA90AF540C8637DE25561660C28A7E6D79C83E53862D0CABF95FFBBDB09F458CA466C8884298D93C5D05441D1D021" decryptionKey="D28ECC8FDE1C50DC6E318BB55D7DFBC82CA6D1E76724FC118CA05CCC8DC6D044" validation="SHA1" decryption="AES"/>
    <add name="Sitefinity" connectionStringName="DefaultConnection" type="Telerik.DataAccess.AspnetProviders.TelerikMembershipProvider, Telerik.DataAccess" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="/" requiresUniqueEmail="false" passwordFormat="Encrypted" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10" passwordStrengthRegularExpression="" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0"/>

    Please my code and web.config settings

    Thanks
  4. Ivan Dimitrov
    Admin
    Ivan Dimitrov avatar
    78 posts

    Posted 17 Jun 2011 Link to this post

    Hi Waji,

    I am not able to replicate this issue using the latest version of Sitefinity 4 - SP1. I even used your machine key.
    Note that you should update the SecurityConfig.config file and the default membership provider.

    <membershipProviders>
            <add passwordFormat="Encrypted" enablePasswordRetrieval="true" name="Default" />
        </membershipProviders>

    Here is the code I used


    var userObj = Membership.GetUser("admin@2");
    var password = userObj.GetPassword();



    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top