0

I'm writing a PHP client that would allow access to any LDAP server.

For various reasons I'd like to be able to access both LDAP 2 and 3 servers.

If I don't make use of any LDAP 3 specific functionality, would it be a reasonable thing to use an LDAP 3 client to access both LDAP 2 and 3 servers?

This would allow me to use the same client implementation for any LDAP server. Is there any better way to go about this?

Rui Gomes
  • 332
  • 1
  • 3
  • 16

2 Answers2

2

The LDAP protocol version can be specified during the Bind operation. A client library should allow you to specify which version you want to use (and the default should be LDAPv3). An LDAPv2 only server will reject Bind requests with the LDAPv3 version.

Ludovic Poitou
  • 4,788
  • 2
  • 21
  • 30
2

Probably not very well. You can use a V2 client with a V3 server. Be aware that on a search request, however, the V3 server may send back data in the full range of UTF-8 format, while a V2 client may be only able to handle data in the IA5 character set.

There are many differences in V2 vs V3.

And as EJP mentioned, it is difficult to even find a LDAP server implementation that does not support v3.

Fianlly v2 has been depricated since 2003 https://tools.ietf.org/html/rfc3494.

-jim

jwilleke
  • 10,467
  • 1
  • 30
  • 51