을 나는 Adldap 확장자 Yii2에서 작업 여기 있어요 : 내 LDAP 서버에서 사용자를 인증하려고 할 때이 문제가 실행 해요 https://github.com/Adldap2/Adldap2Adldap2 인증은 항상 true를 반환 - Yii2
. 성공적으로 연결하고 사용자 데이터를 검색 할 수 있지만 사용자의 사용자 이름과 비밀번호가 맞는지 여부를 인증 할 때 신용이 잘못되어도 항상 true를 반환합니다.
$ad->addProvider($config);
try {
// If a successful connection is made to your server, the provider will be returned.
$provider = $ad->connect();
//User below does return the correct information from the ldap server
$user = $provider->search()->users()->find('quillin');
try{
$provider->auth()->attempt("wrongUsername","wrongPassword");
die("WIN");
}catch(Exception $e){
die("Exception " . $e);
}
}catch (\Adldap\Auth\BindException $e) {
die("There was an issue binding/connecting to the server. <br />" . $e);
}
아무리 사용자 이름과 암호 필드에 넣어 무엇을, 항상 true를 돌려 다이 ("WIN")을 명중; 다음은 (는 config 배열은 물론 표시되지와) 내 코드는 없다 선. 내 composer.json 파일에서, 나는 "adldap2/adldap2"사용하고 있습니다 ". V7.0을 *"
나는 또한 사용하여 사용자를 결합하는 시도 다음도
try{
$provider->auth()->attempt("wrongUsername","wrongPassword", $bindAsUser = true);
die("WIN");
}catch(Exception $e){
die("lose :(");
die("Exception " . $e);
}
그리고 그 항상 true를 반환합니다.