469,898 Members | 1,815 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

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

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!


Apr 14 '06 #1
1 2485
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)?


Apr 15 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Sriram Venkataramani | last post: by
6 posts views Thread by Jimmy | last post: by
1 post views Thread by =?Utf-8?B?ZG90TmV0QnVkZHk=?= | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.