469,950 Members | 2,480 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

Help with user authentication

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
Sep 21 '06 #1
1 1288
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.ToSt ring).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.

--
---------------------------
Thanks,
Ibrahim

Software Consultant - Web Development, GB
"Tarun Mistry" wrote:
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
Sep 21 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Brian Conway | last post: by
3 posts views Thread by Kris van der Mast | last post: by
2 posts views Thread by Bruce Groen | last post: by
3 posts views Thread by Miguel Dias Moura | last post: by
4 posts views Thread by Kimon Ifantidis | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.