Help with user authentication

T

Tarun Mistry

Hi all, I am using the ASP.NET 2.0 security model to impliment user access
control on my site. I have a few questions hopefully someone can answer:

1) From the encrypted ticket stored in the cookie (available in
User.Identity) how can I access the users userId value?

2) If a user is logged in, is the corresponding information in the
aspnet_user and membership tables loaded somewhere that can be accessed?

3) Can the aspnet_user and membership tables be extended to hold some site
specific information?

Thanks for any and all help,
Taz
 
G

Guest

when the user logs in a membership object is created which contains the user
information. So, for instance, you can get the user email id using
Membership.GetUser(Context.User.Identity.Name.ToString).Email

And yes, you can customize the membership services, using membership
provider class. for example, if you want to and a column to the user role,
say, changepasswordonlogin, then you would something like below

<profile enabled="true" defaultProvider="CustomProfileProvider">
<properties>
<add name="changepasswordonlogin" type="boolean"/>
</properties>
<providers>
<add name="CustomProfileProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="ConnectionString"/>
</providers>
</profile>

hope this helps.

--
 

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,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top