在我的“登录”页面上进行 AD 集成。
config/ldap.php
我的用户名和密码都是空的。 (因为每个人都会在表单上登录)
'hosts' => explode(' ',env('LDAP_HOSTS','blabla')),'base_dn' => env('LDAP_BASE_DN','dc=blabla,dc=com,dc=tr'),'username' => env('LDAP_username','username'),'password' => env('LDAP_PASSWORD','secret'),
ldap_auth.php
'sync_attributes' => [
'email' => 'userprincipalname','name' => 'cn',],
auth.php
'providers' => [
'users' => [
'driver' => 'ldap','model' => App\Models\User::class,
我的授权表单功能:
$credentials = ['email' => $this->request['email'],'password' => $this->request['password'],'is_active' => 1];
$remember = $this->request->has('remember');
$results = array('status' => 0,"message" => "Unsuccesfull");
if (Auth::attempt($credentials,$remember)) {
当我尝试登录时。 它回来了;
"message": "Invalid credentials","exception": "Adldap\\Auth\\BindException","file": "/var/www/html/vendor/adldap2/adldap2/src/Auth/Guard.php","line": 107,
它可能有什么问题? 我的 LDAP LDAP_HOSTS 和 LDAP_BASE_DN 信息在 .env 文件中是正确的。
如果是关于我的登录信息,它必须返回“用户名或密码无效”,但它返回“凭据无效”,我想它一定是关于别的东西。