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

A

Andy

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

Andy

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.
 

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

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top