Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Adldap::search()的凭据无效->;用户()->;get(); Laravel版本:5.4 Adldap2 Laravel版本:“^3.0” PHP版本:5.6.30_Laravel_Adldap - Fatal编程技术网

Adldap::search()的凭据无效->;用户()->;get(); Laravel版本:5.4 Adldap2 Laravel版本:“^3.0” PHP版本:5.6.30

Adldap::search()的凭据无效->;用户()->;get(); Laravel版本:5.4 Adldap2 Laravel版本:“^3.0” PHP版本:5.6.30,laravel,adldap,Laravel,Adldap,我设法使与广告的连接起作用,但我似乎无法使Auth::trust起作用。 它总是返回false。有人有什么想法或暗示吗 public function login(Request $request) { $search = Adldap::search()->where('samaccountname', '=', 'tba')->get(); // this is returning the correct user dd($search); /

我设法使与广告的连接起作用,但我似乎无法使Auth::trust起作用。 它总是返回false。有人有什么想法或暗示吗

public function login(Request $request) {

    $search = Adldap::search()->where('samaccountname', '=', 'tba')->get();
    // this is returning the correct user
    dd($search);

    //'username' => 'tba'
    // 'passwrod' => 'is the entered password'
    //this goes into error part
    if (Auth::attempt(request()->only('username', 'password'))) {
        dd('success');
    } else {
        dd('error');
    }

}
“用户名”=>[

/*
|--------------------------------------------------------------------------
| LDAP
|--------------------------------------------------------------------------
|
| This is the LDAP users attribute that you use to authenticate
| against your LDAP server. This is usually the users
|'sAMAccountName' / 'userprincipalname' attribute.
|
| If you'd like to use their username to login instead, insert `samaccountname`.
|
*/

'ldap' => 'samaccountname',

/*
|--------------------------------------------------------------------------
| Eloquent
|--------------------------------------------------------------------------
|
| This is the attribute that is used for locating
| and storing the LDAP username above.
|
| If you're using a `username` field instead, change this to `username`.
|
| This option is only applicable to the DatabaseUserProvider.
|
*/

'eloquent' => 'username',
啊,对,对

Adldap::auth()->尝试(仅请求()->('username','password'))

正在给我一个错误例外:
Adldap\Auth\Guard::trunt()缺少参数2,在第63行的/media/sf_www/prm/app/Http/Controllers/Auth/LoginController.php中调用,并定义了我认为这是非常简单的。函数需要两个参数,您要传递一个参数。快速查看文档显示第一个参数是用户名,第二个参数是密码。执行
request()时->仅('args')
返回一个
数组


相反,请执行
Auth::trunt(request()-get('username'),request()->get('password'))

是的,这是我的失误。代码现在正在运行,但我仍然返回false。
if (Adldap::auth()->attempt(request()->get('username'), request()->get('password'))) {
    dd('success');
} else {
    dd('error');
}
Auth::attempt(request()->only('username', 'password'))