Print Page | Close Window

ASPNet Security and my own table

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2381
Printed Date: 28-Mar-2024 at 8:57am


Topic: ASPNet Security and my own table
Posted By: BillG
Subject: ASPNet Security and my own table
Date Posted: 16-Dec-2010 at 5:25am
In my user database, I have a table called Users, which has a field called UserCd which is the login and a field called password. I want to use ASPNet Security but with my own table called users. Is there sample code showing how to do that?
 
Bill
 



Replies:
Posted By: DenisK
Date Posted: 17-Dec-2010 at 2:55pm
Bill;

It is possible to use your own tables with ASP.NET Membership because it uses a provider model. However, this is outside the scope of DevForce and it is not encouraged to do so. You can see the website below for more info.

http://weblogs.asp.net/scottgu/archive/2005/10/17/427731.aspx

A few suggestions:

1. You can issue a Forms authentication ticket (cookie) when a login occurs and not use the whole ASP.NET Membership architecture. To do this, you could sub-type the AspNetAuthenticatingLoginManager and override the ValidateUserCore method to do your own validation against your own user table.

2. Or you can implement your own login manager entirely and just call FormsAuthentication.SetAuthCookie to set the cookie.

Hope this helps.



Print Page | Close Window