LDAP Query fails from ASP.NET

LDAP Query fails from ASP.NET

Post by bWFyaWEuc » Thu, 01 Sep 2005 19:19:03


Hi,

I've got a problem with an LDAP query submitted from my ASP.NET application.
Configuration: Windows 2003 Server Standard Ed., the application uses
Windows Integrated Authentication and is configured with <identity
impersonate=rue>>

I try to submit the following query:

Dim IdentityName as String = Context.User.Identity.Name
Dim sRoot As String = "LDAP://" + rootDomain

Dim de As New DirectoryServices.DirectoryEntry(sRoot)
de.AuthenticationType = DirectoryServices.AuthenticationTypes.Secure
Or DirectoryServices.AuthenticationTypes.Delegation

Dim filter As String =
String.Format("(&((objectClass=user)(sAMAccountName={0})))",
IdentityName.Split("\"c)(1))
Dim ds As New DirectoryServices.DirectorySearcher(de, filter)

Dim sr As DirectoryServices.SearchResult = ds.FindOne
Dim desr As DirectoryServices.DirectoryEntry = sr.GetDirectoryEntry

This query fails at the last line (sr = Nothing)

If I change the configuration to use Basic authentication, the query succeeds.

If I put a userName and password to the identity tag the query also
succeeds. (but other parts of the program will not work with this
configuration).

I would appriciate any help in this
 
 
 

LDAP Query fails from ASP.NET

Post by naijacoder » Thu, 01 Sep 2005 21:59:16

Try posting your question to the ASP.NET SECURITY section.
There are many issue with this i finally succeded retrieiving GROUPS
from the active Directory after some struggling..
Hope to see you there
Patrick



*** Sent via Developersdex http://www.yqcomputer.com/ ***

 
 
 

LDAP Query fails from ASP.NET

Post by bWFyaWEuc » Fri, 02 Sep 2005 00:47:35

thanks, i will do
 
 
 

LDAP Query fails from ASP.NET

Post by Pat » Fri, 02 Sep 2005 13:36:45

No worries
Maria