473,804 Members | 4,269 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

LDAP Query fails from ASP.NET

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.Id entity.Name
Dim sRoot As String = "LDAP://" + rootDomain

Dim de As New DirectoryServic es.DirectoryEnt ry(sRoot)
de.Authenticati onType = DirectoryServic es.Authenticati onTypes.Secure
Or DirectoryServic es.Authenticati onTypes.Delegat ion

Dim filter As String =
String.Format(" (&((objectClass =user)(sAMAccou ntName={0})))",
IdentityName.Sp lit("\"c)(1))
Dim ds As New DirectoryServic es.DirectorySea rcher(de, filter)

Dim sr As DirectoryServic es.SearchResult = ds.FindOne
Dim desr As DirectoryServic es.DirectoryEnt ry = sr.GetDirectory Entry

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
Nov 19 '05 #1
3 1670
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.developersdex.com ***
Nov 19 '05 #2
thanks, i will do

"naijacoder naijacoder" wrote:
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.developersdex.com ***

Nov 19 '05 #3
Pat
No worries
Maria
"maria.s" <ma****@discuss ions.microsoft. com> wrote in message
news:44******** *************** ***********@mic rosoft.com...
thanks, i will do

"naijacoder naijacoder" wrote:
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.developersdex.com ***

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5186
by: Enigma Webmaster | last post by:
We've had an ASP running for about 9 months which returns a full listing of network users (taken directly from AD), and it has now stopped working with the following; Provider Error '80004005'. If I remove a field called 'userAccountControl' from the field list it works to a certain extent but still fails further down the code with not finding content ofr the field called 'Name'. I think its very probably a permissions error, can...
7
6816
by: Amar | last post by:
I am trying to connect to my college LDAP directory using ASP.NET. This LDap does not have security as it returns only user demographic information. i do not need to bind with a username or credentials. What i am trying to do is, i am trying to look up all the information for the user with user id 'testuser'. The following is the Vb.net code for my aspx page: Dim oRoot As DirectoryEntry = New...
3
2032
by: Jay | last post by:
I have a simple LDAP query (grabs all users from a particular AD group and populates a checkboxlist) that works perfectly fine on the development machine logged on locally as any user. When I access the website and run the query from a client however the query fails to run. Someone please help? Here's the code for the query (in CheckBoxListsFill sub): 'Impersonate the Windows AD user running the application Dim impersonationContext...
1
1353
by: rajens00 | last post by:
LDAP authentication fails with the final release version of ASP.Net 2.0 (and Beta 2 also). I suspect it's a legit bug. Any ideas how to report it?? The following code works fine with Framework 1.1 yet fails with 2.0: string strPath = "LDAP://ldap-3.directory.enterprise.mydomain.gov/"; string strDir = "ou=People,ou=My Agency,ou=My Department,o=U.S. Government,c=US"; DirectoryEntry mySearchRoot = new DirectoryEntry(strPath + strDir);
0
2551
by: Gerry Sinkiewicz | last post by:
Looking for a bit of software that will accept an LDAP query via port 389 and convert it to an SQL query and return the results to the originating LDAP client. Basically a dialect converter LDAP query <===> SQL query. The originating LDAP query will come from an application server. Anyone know of such a thing. I searched, but to no avail, most topics deal with how to query LDAP from
2
5650
by: Anbu | last post by:
Sorry for cross posting the query. But I need a resolution as early as possible. I have developed an application to authenticate the user based on LDAP Search and authentication. The Windows application that was developed using C# works fine. But it fails when I convert this as a DLL or Web Service. I need to host the application on a server to use the result across different applications and on different clients.
0
1188
by: Anbu | last post by:
Sorry for cross posting the query. But I need a resolution as early as possible. I have developed an application to authenticate the user based on LDAP Search and authentication. The Windows application that was developed using C# works fine. But it fails when I convert this as a DLL or Web Service. I need to host the application on a server to use the result across different applications and on different clients.
3
4038
by: RJN | last post by:
Hi I've written a code that queries Windows LDAP server and works fine, but the same doesn't work when querying Solaris LDAP server. DirectoryEntry de = new DirectoryEntry("LDAP://server.com"); DirectorySearcher ds = new DirectorySearcher(de); de.Username = "xxx"; de.Password = "yyy"; de.AuthenticationType = AuthenticationTypes.Secure;
3
18735
by: martybruce | last post by:
I have some VB.net code. Basically when the user logs into the app. It checks to see if the user's AD account password has expired. If so, It will prompt the user to change it. mydn = GetDN(txtUsername.Text) Dim adsPath As String = "LDAP://" & mydn objUser = New DirectoryEntry(adsPath, txtUsername.Text,
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10575
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10076
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4297
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.