473,473 Members | 2,286 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

LDAP-Authentification

Hi there,

I try to make an authorisation bind to the LDAP with ASP.NET. I use the
DirectoryServices Namespace and the MSDN documented way to do it, but every
time I get an "COMException: Server is not operational". Can anyone tell me
what I have to do to avoid this???

Thanks,

Nico
Nov 19 '05 #1
4 4170
First, make sure you have the proper LDAP path. for instance, lets say
your domain is called mycompany.local then your LDAP would be:

LDAP://DC=mycompany,DC=local

then when creating your DirectoryEntry, make sure you have the right
LDAP path, domain and username, and password like so:

DirectoryEntry entry = new
DirectoryEntry("LDAP://DC=mycompany,DC=local","mycompany.local\username", "domainPassword");

If it is complaining about the server, then your problem lays somewhere
in the first couple steps of your authentication.

hope that helps!

Nov 19 '05 #2
Hi,

thanks for that. But I still get the same Exception.

Nico

"DKode" <dk****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
First, make sure you have the proper LDAP path. for instance, lets say
your domain is called mycompany.local then your LDAP would be:

LDAP://DC=mycompany,DC=local

then when creating your DirectoryEntry, make sure you have the right
LDAP path, domain and username, and password like so:

DirectoryEntry entry = new
DirectoryEntry("LDAP://DC=mycompany,DC=local","mycompany.local\username", "domainPassword");

If it is complaining about the server, then your problem lays somewhere
in the first couple steps of your authentication.

hope that helps!

Nov 19 '05 #3
what is the exception you are getting, can you post your code and then
line that is causing the problem?

Nov 19 '05 #4
Hi,

code:

Try
'objDirEntry = New
DirectoryEntry("LDAP://ldap.myCompany.com:636/uid=" & uid &
",ou=People,o=hp.com", "uid=" & uid & ",ou=People,o=hp.com", passwd,
AuthenticationTypes.Secure)
objDirEntry = New
DirectoryEntry("LDAP://ldap.myCompany.com:636/uid=" & uid &
",ou=People,o=myCompany.com", uid, passwd, AuthenticationTypes.Secure)
Catch ex As System.Exception
ErrorLabel.Text = ex.Message
End Try

Dim errortext As String

' get the data from the form
Dim UName As String = username.Text
Dim UDomain As String = domain.Text
Dim UserLogin As String = UDomain & ":" & UName
Dim searcher As DirectorySearcher
' execute search
searcher = New DirectorySearcher(objDirEntry)

searcher.Filter = "(ntUserDomainId=" & UserLogin & ")"

ErrorLabel.Text = searcher.FindOne().Path // <-- this throws the
Exception

Try
Dim dirEntry As New DirectoryEntry(searcher.FindOne().Path,
objDirEntry.Username, objDirEntry.Password, objDirEntry.AuthenticationType)
ErrorLabel.Text =
objDirEntry.Exists(searcher.FindOne().Path).ToStri ng
Catch ex As System.Runtime.InteropServices.COMException
ErrorLabel.Text = ex.Message
'End Try
Exception:

System.Runtime.InteropServices.COMException: The server is not operational

Stack Trace:

COMException (0x8007203a): The server is not operational]
System.DirectoryServices.DirectoryEntry.Bind(Boole an throwIfFail) +514
System.DirectoryServices.DirectoryEntry.Bind() +10
System.DirectoryServices.DirectoryEntry.get_AdsObj ect() +10
System.DirectoryServices.DirectorySearcher.FindAll (Boolean
findMoreThanOne) +199
System.DirectoryServices.DirectorySearcher.FindOne () +31
I only get this Exception when I try to bind a user to the AD. There is no
exception if I read some data from the Directory (like username).
Thanks again

Nico

"DKode" <dk****@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
what is the exception you are getting, can you post your code and then
line that is causing the problem?

Nov 19 '05 #5

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

Similar topics

5
by: dmcconkey | last post by:
Hi folks, I've been searching for a while and haven't found my specific question anywhere else. If this has already been asked, please accept my appologies and point me to the appropriate...
7
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...
1
by: Angel | last post by:
Hello all - I have a LDAP service running on a NT4 box (not a mbr of my AD domain), I'd like to extract the users/attributes from that LDAP service and populate my AD domain with those users and...
4
by: m96 | last post by:
hi, i'm trying to make a query to a ldap server (version v2 or v3 doen't matter) with c#. the query works just fine but the problem is that i can't read the custom attributes/fields, since .net...
4
by: Terry Miller | last post by:
I have DB2 V8.2 loaded on a Redhat Enterprise Linux version 3 (RHEL 3) box. RHEL is configured to talk to LDAP for authenticaton besides the local passwd file. I can verify this by executing an su...
2
by: duncan beaumont | last post by:
Hi, - SQLserver 2000 - Yellowfin 2.4 - Windows 2003 server I have been asked to investigate seting up LDAP authentication to access our Yellowfin reporting.
5
by: Jed Parsons | last post by:
Hi, authenticates a user against our ldap server.: User types in name and password, and module sees if name and password check out right with the ldap server. I see that it's pretty...
3
by: sallas | last post by:
Hi, I have a simple LDAPS script: #!/usr/bin/python2.3 import sys import ldap if __name__ == '__main__': ldap.set_option(ldap.OPT_DEBUG_LEVEL,255)
0
by: rbukkara | last post by:
Hi, I have got the following error while trying to add a user in the LDAP Directory. javax.naming.NameNotFoundException: ; remaining name 'uid=vassila,ou=People,dc=cs,dc=uno,dc=edu' I have...
0
by: Sells, Fred | last post by:
I'm running python 2.5 (or 2.4) in an XP environment. I downloaded and installed the .dll's from OpenLDAP-2.4.8+OpenSSL-0.9.8g-Win32.zip and copied the .dll's in c:/windows/system32 as instructed...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.