|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2011-01-23 21:19 UTC] jani@php.net
-Package: Feature/Change Request
+Package: LDAP related
[2011-05-24 18:45 UTC] post at rolandgruber dot de
[2013-04-11 13:08 UTC] carmageddon at gmail dot com
[2015-03-02 14:12 UTC] johnnywiller10 at gmail dot com
[2015-03-02 14:12 UTC] johnnywiller10 at gmail dot com
[2015-03-02 14:12 UTC] johnnywiller10 at gmail dot com
[2015-03-02 14:37 UTC] daniellucenag at gmail dot com
[2015-03-02 18:12 UTC] johnnywiller10 at gmail dot com
[2015-03-02 20:25 UTC] post at rolandgruber dot de
[2015-03-02 20:46 UTC] johnnywiller10 at gmail dot com
[2015-03-03 12:18 UTC] daniellucenag at gmail dot com
[2015-03-03 12:32 UTC] johnnywiller10 at gmail dot com
[2015-03-03 12:37 UTC] daniellucenag at gmail dot com
[2015-03-03 12:40 UTC] johnnywiller10 at gmail dot com
[2015-03-03 13:17 UTC] daniellucenag at gmail dot com
[2015-03-03 13:20 UTC] johnnywiller10 at gmail dot com
[2015-03-03 13:25 UTC] daniellucenag at gmail dot com
[2015-03-03 13:44 UTC] johnnywiller10 at gmail dot com
[2015-05-05 19:43 UTC] andreas at heigl dot org
[2015-05-05 20:20 UTC] johnnywiller10 at gmail dot com
[2015-06-17 13:44 UTC] mcmic@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: mcmic
[2015-06-17 13:44 UTC] mcmic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 22:00:02 2025 UTC |
Description: ------------ Hi, Let's assume, that we are connecting to an MS AD Server. And the user has set the flag, that he must reset his password. ( Therefore the user isn't permitted to login until he has reset his password. ) What kind of message do we when the Bind command fails? Code: $ds=ldap_connect($host); if (!ldap_bind($ds, $username, $password)) { printf("LDAP-Fehlernummer: %s<br>\n", ldap_errno($ds)); printf("LDAP-Fehler: %s<br>\n", ldap_error($ds)); } The output is the following: LDAP-Fehlernummer: 49 LDAP-Fehler: Invalid credentials Ok, php told us, that the bind failed. But let's switch to the console, and take a look at the output, that ldap-search will give us: Command: ldapsearch -x -H ldap://der-ad-server.de:389 -D accountname@der-ad-server.de -W Output: ldap_bind: Invalid credentials (49) additional info: 80090308: LdapErr: DSID-0C0903AA, comment: AcceptSecurityContext error, data 773, v1771 The first line is the same, but ldapsearch shows another line. This line is very useful, because we can now read out the error code the AD told us. (773) An the active directory has several interesting codes: 525 - user not found 52e - invalid credentials 530 - not permitted to logon at this time 531 - not permitted to logon from this computer 532 - password expired 533 - account disabled 701 - account expired 773 - user must reset password 775 - account locked As you see a more precise error message (similar to ldapsearch), would give a php developer much more information on what went wrong and not just a failed message... Reproduce code: --------------- $ds=ldap_connect($host); if (!ldap_bind($ds, $username, $password)) { printf("LDAP-Fehlernummer: %s<br>\n", ldap_errno($ds)); printf("LDAP-Fehler: %s<br>\n", ldap_error($ds)); } VERSUS ldapsearch -x -H ldap://der-ad-server.de:389 -D Expected result: ---------------- A more precise error message. Perhaps something like: LDAP-Fehlernummer: 49 LDAP-Fehler: Invalid credentials, additional info: 80090308: LdapErr: DSID-0C0903AA, comment: AcceptSecurityContext error, data 773, v1771 Actual result: -------------- A very unprecise error message: LDAP-Fehlernummer: 49 LDAP-Fehler: Invalid credentials