Porting data into the ASP.NET Membership system through the APIs

Over the past couple of days, I have been working on porting some user data into the ASP.NET Membership system.  I started off by writing some sql scripts, however, when I hit the password, I ran into a small problem.  I didn't see any simple way to process the password into a format in the membership table in easy sql.  I dropped back and wrote some c# to do this.  It appears to be working so far.  One of the requirements was to use as much of the existing ASP.NET Membership APIs.  As a result, we decided to port the data over instead of implementing our own provider.  In the future, we will probably write a provider that inherits from the existing provider. 

Anyway, one of the things we had to do to do was to move the existing passwords over.  The existing passwords did not support the default security checks, but we wanted to support the existing passwords.  How did we overcome this?  In the app that I wrote, I set the following attributes in the web.config on the membership provider:

minRequiredPasswordLength="1"

minRequiredNonalphanumericCharacters="0"

Comment:We didn't make this choice with no thought involved.  We did it to make this simpler on the users during the transistion.

This seems to have resolved the issues of creating the users through the api.

I'll be posting more on this over the next few weeks.  As always, if you have any suggestions, I'm glad to hear them.  :-)

No Comments