R – AspNetSqlMembershipProvider and PasswordRecovery Control

asp.netasp.net-2.0membershipmembership-providerpasswords

My scenario is I have a asp.net 2.0 application web application which had the AspNetSqlMembershipProvider properties as:

enablePasswordRetrieval="false" and passwordFormat="Hashed"

But now the need has risen to store user's passwords unencrypted as clear text and display them to Superusers. I have done this by changing the AspNetSqlMembershipProvider properties to:

enablePasswordRetrieval="true" and passwordFormat="Clear"

The problem is the way the PasswordRecovery control behaves. From what I have read it checks the properties of the AspNetSqlMembershipProvider tag if enablePasswordRetrieval="true" and passwordFormat="Clear" it will attempt to retrieve the password this is causing a problem when the password is effectively still stored as a hashed one. Is there any way of forcing the PasswordRecovery control to reset not retrieve the password when AspNetSqlMembershipProvider properties are enablePasswordRetrieval="true" and passwordFormat="Clear"?

Sorry for the long winded explanation, all help / pointers very much appreciated as always. Thank you.

Best Answer

I don't think you'll have any luck trying to use two methods for storing passwords in the database.

My advice is to change the passwords on the accounts that have hashed passwords so they get stored as plain text and move on from there.

Alternatively, if you must store some hashed and some clear-text passwords, you'll have to look at extending the membership provider to support this. In my experience, this is often more trouble than it's worth.