asp.net + c# -> HttpContext.Current.User + directoryentry

N

Nicopilami

Hi everybody

i'm trying to open a directory services connection under the
users' (who is navigating the webpage) credentials, like
impersonation, but i don't succeed, could you help me ?

the problematic line is the following :

DirectoryEntry Ldap = new DirectoryEntry(ConnexionAD,
ADusername, ADpassword);

actually, i would like to retrieve ADusername and ADpassword from
HTTPcontext.current.user becaus the user is authenticated by forms. Is
there a way for doing that ?

thx by advance
Nico
 
J

Joe Kaplan

You don't have Windows credentials of the logged on user to impersonate when
you use forms authentication and the user's password is not available to you
in general as it is only captured during the login. In order to get those
credentials, you'll need to capture them during the forms auth login and
store them somewhere in a safe way so they can be retrieved later.

You could also consider switching to Windows auth instead.

Joe K.
 
N

Nicopilami

You don't have Windows credentials of the logged on user to impersonate when
you use forms authentication and the user's password is not available to you
in general as it is only captured during the login. In order to get those
credentials, you'll need to capture them during the forms auth login and
store them somewhere in a safe way so they can be retrieved later.

You could also consider switching to Windows auth instead.

Joe K.
--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"http://www.directoryprogramming.net

Hi everybody

ok, that's what i've finally done, stored into the session variables,
as encrypted variable; it's not very beautiful, but it works well :eek:)

thx
bye
Nico
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top