I give up :(
Using ldapsearch in ubuntu:
ldapsearch -x -LLL -h xx.xxxx.xx:3268 -D login -w password -b "DC=uni-xx,DC=xx" -v -s sub "userprincipalname=xx8870@student.xxx.xx"
returns correct informations for this user.
Moving to php on the same server:
if (($connect = ldap_connect($ldap_server, $obj->port))) {
ldap_set_option($connect, LDAP_OPT_REFERRALS, 0);
ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, $obj->LDAP_OPT_PROTOCOL_VERSION);
$dn = $obj->contexts; //"DC=uni-xx,DC=xx"
$bu = $obj->bind_user; //login
$bp = $obj->bind_pw; //password
$bind = ldap_bind($connect, $bu, $bp);
if($bind){
$is_tu_user = ldap_search($connect, $dn, "(userprincipalname=*xx8870*)", array("cn", "mail"));
echo ldap_error($connect);
$info = ldap_get_entries($connect, $is_tu_user);
print_r(" sss " . json_encode($info));die();
}
}
returns array with zero elements:
{"count":0}
PHP is version 7.2. LDAP extension is up and running.