2016-05-09 2 views
0

J'ai un AD ldap.patontheback.org et j'essaye de faire ldap_bind avec le compte administrateur par défaut. Le même compte que je peux utiliser avec succès bureau à distance avec pour administrer les utilisateurs.Pourquoi ldap_bind ne parvient pas à s'authentifier auprès de SimpleAD?

$ldapconn = ldap_connect("ldap://172.31.22.45"); 
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7); 
ldap_bind($ldapconn, "cn=Administrator,dc=ldap,dc=patontheback,dc=org", "<my password>"); 

Ce qui peut se connecter, mais n'authentifie pas:

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 172.31.22.45:389 
ldap_new_socket: 3 
ldap_prepare_socket: 3 
ldap_connect_to_host: Trying 172.31.22.45:389 
ldap_pvt_connect: fd: 3 tm: -1 async: 0 
ldap_open_defconn: successful 
ldap_send_server_request 
ldap_result ld 0x2bb31e0 msgid 1 
wait4msg ld 0x2bb31e0 msgid 1 (infinite timeout) 
wait4msg continue ld 0x2bb31e0 msgid 1 all 1 
** ld 0x2bb31e0 Connections: 
* host: 172.31.22.45 port: 389 (default) 
    refcnt: 2 status: Connected 
    last used: Mon May 9 13:45:10 2016 


** ld 0x2bb31e0 Outstanding Requests: 
* msgid 1, origid 1, status InProgress 
    outstanding referrals 0, parent count 0 
    ld 0x2bb31e0 request count 1 (abandoned 0) 
** ld 0x2bb31e0 Response Queue: 
    Empty 
    ld 0x2bb31e0 response count 0 
ldap_chkResponseList ld 0x2bb31e0 msgid 1 all 1 
ldap_chkResponseList returns ld 0x2bb31e0 NULL 
ldap_int_select 
read1msg: ld 0x2bb31e0 msgid 1 all 1 
read1msg: ld 0x2bb31e0 msgid 1 message type bind 
read1msg: ld 0x2bb31e0 0 new referrals 
read1msg: mark request completed, ld 0x2bb31e0 msgid 1 
request done: ld 0x2bb31e0 msgid 1 
res_errno: 49, res_error: <Simple Bind Failed: NT_STATUS_LOGON_FAILURE>, res_matched: <> 
ldap_free_request (origid 1, msgid 1) 
ldap_parse_result 
ldap_msgfree 
ldap_err2string 
PHP Warning: ldap_bind(): Unable to bind to server: Invalid credentials in php shell code on line 1 

J'ai vérifié le tripple mot de passe est correct. L'IP vers LDAP que j'ai reçu du serveur Windows:

C:\Users\Administrator>nslookup ldap.patontheback.org 
Server: AWS-4A06F0BDB6.ldap.patontheback.org 
Address: 172.31.22.45 

Name: ldap.patontheback.org 
Addresses: 172.31.22.45 
      172.31.2.194 

Que diable me manque?

Répondre

0

Je pourrais l'obtenir au travail en utilisant UPN comme IDENTIFIE:

ldap_bind($ldapconn, "[email protected]", "<password>"); 

Il fonctionne, mais il n'explique pas pourquoi l'inverse ne fonctionne pas.