Nedaří se mi na LDAP připojit:
PHP:
function ldapQuery($filter, $baseDN = "OU=Users,DC=firma-cz,DC=local", $server = "192.168.1.6") {
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
$ldapCon = ldap_connect($server);
if($ldapCon) {
ldap_set_option($ldapCon, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ldapCon, LDAP_OPT_REFERRALS, 0); /
$res = ldap_bind($ldapCon, "CN=muj.uzivatel,OU=Users,DC=firma-cz,DC=local", "moje@heslo");
if($res === false) {
echo "Autentizace selhala."; ldap_close($ldapCon); return false;
}
....shortened
v konzoli na webu se mi vrací Autentizace selhala.
zvláštní, to co vidím na serveru se mi jeví jako by spojení bylo navázáno
ldap_create
ldap_url_parse_ext(ldap://192.168.1.6:389)
ldap_sasl_bind_s
ldap_sasl_bind
ldap_send_initial_request
ldap_new_connection 1 1 0
ldap_int_open_connection
ldap_connect_to_host: TCP 192.168.1.6:389
ldap_new_socket: 44
ldap_prepare_socket: 44
ldap_connect_to_host: Trying 192.168.1.6:389
ldap_pvt_connect: fd: 44 tm: -1 async: 0
attempting to connect:
connect success
ldap_open_defconn: successful
ldap_send_server_request
ldap_result ld 0x7f7ffa0e7150 msgid 1
wait4msg ld 0x7f7ffa0e7150 msgid 1 (infinite timeout)
wait4msg continue ld 0x7f7ffa0e7150 msgid 1 all 1
** ld 0x7f7ffa0e7150 Connections:
* host: 192.168.1.6 port: 389 (default)
refcnt: 2 status: Connected
last used: Tue May 14 14:25:01 2019
** ld 0x7f7ffa0e7150 Outstanding Requests:
* msgid 1, origid 1, status InProgress
outstanding referrals 0, parent count 0
ld 0x7f7ffa0e7150 request count 1 (abandoned 0)
** ld 0x7f7ffa0e7150 Response Queue:
Empty
ld 0x7f7ffa0e7150 response count 0
ldap_chkResponseList ld 0x7f7ffa0e7150 msgid 1 all 1
ldap_chkResponseList returns ld 0x7f7ffa0e7150 NULL
ldap_int_select
read1msg: ld 0x7f7ffa0e7150 msgid 1 all 1
read1msg: ld 0x7f7ffa0e7150 msgid 1 message type bind
read1msg: ld 0x7f7ffa0e7150 0 new referrals
read1msg: mark request completed, ld 0x7f7ffa0e7150 msgid 1
request done: ld 0x7f7ffa0e7150 msgid 1
res_errno: 49, res_error: <80090308: LdapErr: DSID-0C090400, comment: AcceptSecurityContext error, data 52e, v1db1>, res_matched: <>
ldap_free_request (origid 1, msgid 1)
ldap_parse_result
ldap_msgfree
ldap_err2string
ldap_free_connection 1 1
ldap_send_unbind
ldap_free_connection: actually freed