This is a migrated thread and some comments may be shown as answers.

How to GetPassword in sitefinity Membership API

3 Answers 221 Views
Forum suggestions
This is a migrated thread and some comments may be shown as answers.
Waji
Top achievements
Rank 1
Waji asked on 14 Jun 2011, 12:56 PM
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

3 Answers, 1 is accepted

Sort by
0
Ivan Dimitrov
Telerik team
answered on 14 Jun 2011, 03:00 PM
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 >>

0
Waji
Top achievements
Rank 1
answered on 14 Jun 2011, 03:15 PM
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
0
Ivan Dimitrov
Telerik team
answered on 17 Jun 2011, 11:34 AM
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
Tags
Forum suggestions
Asked by
Waji
Top achievements
Rank 1
Answers by
Ivan Dimitrov
Telerik team
Waji
Top achievements
Rank 1
Share this question
or