-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ldap_bind fails to bind when the password contains special characters #11407
Comments
Did you use ldap_escape on the password? |
Tried that too, still doesn't work. |
Is there any update ? |
Ok i found a solution : |
AH! OK. Makes sense! We should probably set that as default if it wasn't set... |
That would probably be a good idea. |
Unfortunately for me it doesn't work. I have it like this: $ldaprdn = $usernameDomain . "\\" . $usernameUID;
$ldapConnection = ldap_connect($ldapServer);
ldap_set_option($ldapConnection, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ldapConnection, LDAP_OPT_REFERRALS, 0);
$bind = @ldap_bind($ldapConnection, $ldaprdn, html_entity_decode($password));
if ($bind)
{
//All good!
}
else
{
//Fail
} I'm running PHP 8.2.3 on Arch Linux and the LDAP server is a Windows Server 2022 instance. I'm yet to test with other implementations to see whether this issue is specific to PHP. My password is simply |
Did you try this : #11407 (comment) ? |
its literally line 4 on the config excerpt. |
What ... This lines just appeared. Idk what just happened |
Description
Any ldap password that contains special characters such as "!", "_" or "&" fails to bind where stripping those characters from the password works.
Tested on PHP7.4 and PHP8.0
PHP Version
8.0.1
Operating System
Raspbian 11
The text was updated successfully, but these errors were encountered: