Custom user management and login

L

Lieven

Hello,

I need to create an asp.net 2.0 site where users login with a X509
certificate. I have a db with certificate serialnumbers mapped to user
specific information like firstname, lastname, address, job,... In my website
I want to have an easy way to access these fields like User.Firstname .
What is the best way to implement this? Can I create a custom membership
provider? Is it possible to extend for example the property Page.User so that
I can write Page.User.Address ? I know how to access a X509 certificate. Is
the membershipprovider also applicable with certificate login or only with
username/password login?
Please give me some advice so I know where to start.

grt,

Lieven
 
D

Dominick Baier [DevelopMentor]

Hi,

you don't need a custom membership provider - they are not really suited
for what you want to do..

The authentication infrastructure is indeed extensible - Page.User.Identity
points to an object that implements the IIdentity interface. You can build
your own object (either by deriving from CustomIdentity or by starting from
scratch)

You can then handle the AuthenticateRequest event (e.g. in global.asax) -
fetch the data for the user and populate your new Identity object.
Afterwards you replace the standard identity object with yours..


MyIdentity myNewIdentity = new ...
GenericPrincipal p = new GenericPrincipal(myNewIdentity);
Context.User = Thread.CurrentPrincipal = p;

make sense?
 
L

Lieven

Thank you for your respons. I really had no idea where to start. I now have a
much better overview of how I can implement this. Thanks for your answer!
Further remarks are of course still welcome.

grt,

Lieven
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top