views:

257

answers:

1

I have been tasked with migrating an existing mature ASP.NET 2.0 web site to NHibernate, Mono and MySQL or postgres. I am somewhat confused as how the membership provider salts the passwords. If I make the switch and use the MySQL membership provider (outlined in this question) or AspSqlProvider, will the existing users be able to login?

I guess it would be easier for me to ask: How the hell do I get access to the encryption key used by the ASP.NET membership provider that salts the passwords so that I can use the same one in a third party provider?

A: 

How many users are you talking for this site? Is it publicly accessible, or something used within a company LAN?

Transferring your existing membership database to the schema generated by the MySQL provider could get interesting. I'm not even sure how similar the table schemas they use are, though I would hope they are quite close.

If the number of users is relatively small, I would strongly consider forcing a password reset upon changing to the new system.

edit just saw you added postgres while I was typing - if your database choice is still up in the air it may be easier to use an ORM-based provider that offers you a bit of portability (and consistent behavior)

if using nhibernate, I was recently looking for an nhibernate-based membership provider and ended up choosing this one: Fluent NHibernate Membership Provider (CodeProject). Got it to work for me with minimal modification, but its for a greenfield project without these concerns. It is on mono though :)

found this: Membership Providers - see the "DataSchema" section, aspnet_Membership table. Looks like getting the salt won't be a problem, so you should be able to get this working w/o password resets.

AlexCuse
Resetting passwords is a deal breaker :) That was my initial thought as well, but it's a no go for the client. The site is publicly accessible.
ScottBelchak
I should have also mentioned that we are also migrating to nHibernate and moving away from stored procedures. Hence, the removal of the asp.net membership provider (stored procs)
ScottBelchak
See the last line I added - looks like you can retrieve the salts from the table aspnet_Membership so you should be able to pull this off without a password reset.
AlexCuse