Help with user authentication

Discussion in 'ASP .Net' started by Tarun Mistry, Sep 21, 2006.

  1. Tarun Mistry

    Tarun Mistry Guest

    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
     
    Tarun Mistry, Sep 21, 2006
    #1
    1. Advertising

  2. 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.

    --
    ---------------------------
    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
    >
    >
    >
     
    =?Utf-8?B?SWJyYWhpbSBTaGFtZWVxdWU=?=, Sep 21, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew Connell
    Replies:
    1
    Views:
    548
    Natty Gur
    Oct 21, 2003
  2. raj mandadi
    Replies:
    0
    Views:
    431
    raj mandadi
    Dec 22, 2003
  3. Brett Porter
    Replies:
    2
    Views:
    772
    Andrea D'Onofrio [MSFT]
    Jan 20, 2004
  4. CodeCowboy
    Replies:
    2
    Views:
    2,433
    CodeCowboy
    Feb 23, 2005
  5. Timothy Parez

    User Authentication, Active Directory and more (help)

    Timothy Parez, Jun 17, 2004, in forum: ASP .Net Security
    Replies:
    9
    Views:
    211
    Joe Kaplan \(MVP - ADSI\)
    Jul 5, 2004
Loading...

Share This Page