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



On 14 mar, 15:30, "Joe Kaplan"
<joseph.e.kap...@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
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
--"Nicopilami" <n.chauss...@xxxxxxxxx> wrote in message

news:6f29c9d4-01cc-4265-9630-5f814ac625f4@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> 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

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 :o)

thx
bye
Nico
.



Relevant Pages

  • Re: Integrated Windows Authentication Timeout?
    ... I got rid of the viewstate error. ... "Joe Kaplan" wrote: ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ... Integrated Windows Authentication ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: How to bypass Forms Authentication on selected pages programma
    ... "Joe Kaplan" wrote: ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ... for authentication. ...
    (microsoft.public.dotnet.security)
  • Re: How to bypass Forms Authentication on selected pages programma
    ... "Joe Kaplan" wrote: ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ... for authentication. ...
    (microsoft.public.dotnet.security)
  • Re: Recommended strategy for providing access to web apps via Inte
    ... "Joe Kaplan" wrote: ... opened the firewall up for LDAP, the external entity can execute ANY LDAP ... These federated authentication protocols are designed to address these ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ...
    (microsoft.public.windows.server.active_directory)
  • Non-AD Kerberos authentication
    ... I've been posting back and forth with Joe Kaplan (his most recent post is ... etc. when doing the authentication. ... Windows to do it yourself, but I'm not an expert at this. ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ...
    (microsoft.public.platformsdk.security)