PDA

View Full Version : PHP LDAP authentication fails when password ends in special character



apjone
March 20th, 2009, 02:14 PM
Hey,

Haven't asked this on php forum yet, but google didnt seem to help ( tried phrasing it several ways). I am writing a bit of code for a php page authenticating against active directory. This works except when a user has a '!' at the end of the password. then it bombs out. The code I am using is bellow.


ldap_bind($ad,"$user@domain.com","$pass")

CORRECTION = Passwords ending in numbers or symbols do not work

Any help would be appreciated.

apjone
March 22nd, 2009, 04:23 PM
Ok after reading php.net I finally found waht needs to be done, and if memory serves I have done it before. I needed to utf8 decode the password string.



utf8_decode($password)