Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Create user within the Login Control

Reply
Thread Tools

Create user within the Login Control

 
 
TheDude5B
Guest
Posts: n/a
 
      10-31-2007
Hi,

I have a problem with existing customers from an old site, coming to
my new asp.net 2.0 site with the user roles and membership, and trying
to login with their old details.

As you know, the new built in membership encrypts passwords (I know
you can use the system without encrypting the passwords, but this what
i have unfortunetaly gone with), so I can not simply import the data
from the old database into the new one.

My idea was to create users on the fly if they try to log in user
their old details. Basically, when a user try's to login, if their
details dont exist in the new site, I will then search the old
database on LoginError using the details they have just provided
trying to login. If they are found in the old database, then I will
use their old details and create a new account for them.

So I can get their username and password which they type into the
Login Control, then I search the old database and get their details,
but then how can I go about creating a new account for them using the
asp.net memberships?
i.e. basically dynamically adding their details into the
CreateUserControl, and creating a user, but without the user seeing
this going on?

Is there such a way to do this?

or is there an easier way to import their old details into the new
system and encrypt their passwords?

Thanks

 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      10-31-2007
Yes, you can circumvent the way a person logs in to examine another table
and then allow them to log in. If you go this route, I would take the info
they are logging in with and "change" the password at that time. You can
also write your own membership provider that checks both places and even use
it to encrypt the password using the key in the web.config file (which is
what the built in membership FUD uses).

To do what you are intending, you will want to override event handlers from
the login control so you can look the user up when he logs in and create his
new account. Most likely you will override the LoggingIn event handler.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
"TheDude5B" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> Hi,
>
> I have a problem with existing customers from an old site, coming to
> my new asp.net 2.0 site with the user roles and membership, and trying
> to login with their old details.
>
> As you know, the new built in membership encrypts passwords (I know
> you can use the system without encrypting the passwords, but this what
> i have unfortunetaly gone with), so I can not simply import the data
> from the old database into the new one.
>
> My idea was to create users on the fly if they try to log in user
> their old details. Basically, when a user try's to login, if their
> details dont exist in the new site, I will then search the old
> database on LoginError using the details they have just provided
> trying to login. If they are found in the old database, then I will
> use their old details and create a new account for them.
>
> So I can get their username and password which they type into the
> Login Control, then I search the old database and get their details,
> but then how can I go about creating a new account for them using the
> asp.net memberships?
> i.e. basically dynamically adding their details into the
> CreateUserControl, and creating a user, but without the user seeing
> this going on?
>
> Is there such a way to do this?
>
> or is there an easier way to import their old details into the new
> system and encrypt their passwords?
>
> Thanks
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot open user default database. Login failed. Login failed for user 'HEMPC\ASPNET' Tony Johansson ASP .Net 3 01-02-2010 04:09 PM
Passing Parameters to user control within another user control hmikki ASP .Net Web Controls 1 10-19-2007 02:00 AM
Can't create simple login page using asp:login control Sasquatch ASP .Net 2 10-03-2006 09:22 PM
Hosting a user control within a user control Charlie@CBFC ASP .Net 2 10-15-2005 08:55 PM
User Control within User Control - Event not firing Don ASP .Net 3 03-11-2005 05:56 PM



Advertisments