LDAP Query fails from ASP.NET

G

Guest

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=â€true†/>

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
 
N

naijacoder naijacoder

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
 

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,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top