Can't authenticate against LDAP running on port 636
807573Nov 20 2007 — edited Nov 26 2007Hi,
I have a login page on my website that authenticates users against an active directory. I have been successful in connecting and authenticating my users when I connect and authenticate them against the active directory when I use the following:
int port = 389;
String host = "hostA";
LDAPConnection ld = new LDAPConnection();
ld.connect(host, port);
ld.authenticate(dname, password);
But I am unsuccessful when I do the following:
int port = 636;
String host = "hostB";
LDAPConnection ld = new LDAPConnection();
ld.connect(host, port);
ld.authenticate(dname, password);
The "ld.connect(host, port)" will be successful but the "ld.authenticate(dname, password)" will return the following error:
netscape.ldap.LDAPException: Server or network error (81)
at netscape.ldap.LDAPConnThread.networkError(LDAPConnThread.java:687)
at netscape.ldap.LDAPConnThread.run(LDAPConnThread.java:479)
It seems that hostB uses SSL LDAP, therefore, that is why the port is 636. When I output "ld.isConnected()" after "ld.connect(host, port)", it states that it is connected, so I'm not sure what the error message means. Is there anything I need to change in my code so that I can authenticate my users against the active directory in hostB? Please help. Thanks.!