Page 1 of 1

MySqlMembershipProvider and GetPassword

Posted: Wed 25 May 2011 10:38
by hamsterlegs
Hi,

I need to retrieve the passwords for my users (as I'm migrating the system).

Originally my web.config was setup like this:



With this, if I call GetMethod I get NotSupportedException "Specified method is not supported.".

I then tried changing:

enablePasswordRetrieval="true"

But I still get the same exception. I'm using Version=4.85.33.0.

I can get the hashed password directly from MySql but I do not know how to decrypt this. I do not have a machineKey element specified in my web.config.

Please advise how I can retrieve my passwords.

Thanks

Posted: Mon 30 May 2011 15:37
by Shalex
Here are the results I have received in our environment:
1) [enablePasswordRetrieval="false"] NotSupportedException: Specified method is not supported.
2) [enablePasswordRetrieval="true"] Parser Error Message: Cannot retrieve Hashed passwords.

This is a designed behaviour. MSDN:
If EnablePasswordRetrieval is false, the membership provider will return an exception. If the provider supports passwords with a PasswordFormat of Hashed, you will be unable to retrieve the password for the membership user and should consider making use of the ResetPassword method when a user has forgotten his or her password.
A ConfigurationException will be thrown if enablePasswordRetrieval is set to true and passwordFormat is set to Hashed in the Web.config file for the ASP.NET application.

Posted: Mon 30 May 2011 17:22
by hamsterlegs
Thanks but this doesn't really help in the migration process.

Fortunately, I found http://www.devart.com/forums/viewtopic.php?t=20034 which means I can transfer and use the hashed passwords.

Posted: Sat 11 Jun 2011 06:43
by Zero-G.
Hey

May I ask, from what to what you want to migrate? - Maybe there are system own tools the better way!?

mySQL itself makes things like that for it's own, when upgrading from an older version to a new one

But I think, that reading out the passwords will not be so easy because of security thinking...

Posted: Sat 11 Jun 2011 09:12
by hamsterlegs
Hi,

I was migrating to SQL Azure, there are tools available for this process however I was concerened about the password migration. Fortunately this was not a problem and I could migrate the hashed passwords.

Thanks,

HL