Possible? Authentication using Windows/Active directory, but access SQL Server using Membership clas

Discussion in 'ASP .Net' started by Andy, Apr 15, 2006.

  1. Andy

    Andy Guest

    Hi, I was wondering if someone could advise on if the following is
    possible. I have one website that is available to the public using
    Forms authentication and the Membership class, it creates/stores user
    information in a SQL Server 2005 db. I have another website that will
    administer the first website, allowing admins to look at all of the
    users in the db and see specific info from the database.The admin site
    is more secure than the general user site and is using Windows
    authentication through active directory with impersonation turned on,
    anonymous access off, and basic authentication on w/ SSL.

    What I'd like to happen is an admin user logs on to the admin site
    through windows authentication, then using the Membership class
    functionality, pluck information from the db about the public
    users(such as displaying all the users in a datagrid using
    Membership.getAllUsers) . The problem is my program fails when I try to
    use any of the Membership functions that access the database, I'm
    assuming this is because I'm trying to access the databse using the
    Membership class, but that class has no idea who the user is. (i do
    however have the membership element in web.config properly set). Is
    there any way to manually create a membership object using the login
    parameters the user entered into the windows authentcation login? If my
    explanation is too confusing, ill be happy to clarify, im stuck!

    Thanks.
     
    Andy, Apr 15, 2006
    #1
    1. Advertising

  2. Andy

    Andy Guest

    After another day of debugging, I can narrow down my question. When I
    attempt to use any of the Membership class functions that access the
    db, it is the mydomain/processidentity that attemps to log in to sql
    server, and this fails as explained above. Accessing the database by
    other means, such as creating my own sql commands, sqldatareaders,
    etc., correctly logs into sql server as the impersonated user and works
    properly. So it seems that the problem is the Membership class
    functions run under the processidentity id, not the impersonated user
    id. Is there a way around this (besides sql server granting login
    rights to mydomain/processidentity)?

    Thanks.
     
    Andy, Apr 15, 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. Michael
    Replies:
    1
    Views:
    428
  2. =?Utf-8?B?UmV6YQ==?=
    Replies:
    3
    Views:
    17,962
    Carlos Barini
    Jun 7, 2004
  3. K SK
    Replies:
    1
    Views:
    184
    Daniel Fisher\(lennybacon\)
    Dec 10, 2004
  4. metridevkk
    Replies:
    2
    Views:
    494
    John M Deal
    Dec 6, 2004
  5. David
    Replies:
    14
    Views:
    859
    Patrick.O.Ige
    Nov 4, 2005
Loading...

Share This Page