Skip to content
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 Support: Check for adding LDAP_OPT_REFERRALS option. #93

Open
alorbach opened this issue May 11, 2023 · 1 comment
Open

LDAP Support: Check for adding LDAP_OPT_REFERRALS option. #93

alorbach opened this issue May 11, 2023 · 1 comment

Comments

@alorbach
Copy link
Member

add in line functions_users.php at line 302 :
ldap_set_option($ldapConn, LDAP_OPT_REFERRALS,0);
TODO: Check why this setting should be enabled / disabled.

@alorbach
Copy link
Member Author

Details , could be made configureable:

The LDAP_OPT_REFERRALS option in LDAP connections is used to handle referrals automatically. A referral in LDAP is a type of response from the server indicating that the client should look elsewhere to fulfill its request. This often happens in distributed LDAP environments, where no single server has a complete view of the entire directory.

However, when connecting to a Windows Server (like the 2012 version in your question), you might be using Simple Bind to authenticate via LDAP, which is a common method. When Simple Bind is used with Microsoft's Active Directory, it doesn't handle LDAP referrals properly. If your application follows the referral to another domain controller, it will attempt to authenticate anonymously, which often fails if anonymous binds are not allowed in your Active Directory environment.

Therefore, the setting ldap_set_option($ldapConn, LDAP_OPT_REFERRALS,0); is used to disable automatic referral following in the PHP LDAP library. The 0 means "no", so it turns off referrals. This allows the Simple Bind to authenticate correctly without getting tripped up by referrals.

In general, setting LDAP_OPT_REFERRALS to 0 is a common practice when dealing with Microsoft's Active Directory, and it's often necessary to allow the authentication to proceed properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant