Open montes2012 opened 9 years ago
I also receive this undefined index error. Do you receive this after successfully authenticating against your LDAP?
Any luck with this? I get an "ErrorException in adLDAPCollection.php line 89: Undefined offset: 0" every time I try to login, Could you give us a working example of the config?
I'm trying to authenticate with this test server
http://www.forumsys.com/tutorials/integration-how-to/ldap/online-ldap-test-server/
using the email, so my auth.php files looks like this.
'fields' => [
'username' => 'samaccountname',
'name' => 'displayName',
'firstname' => 'givenName',
'lastname' => 'sn',
'groups' => 'memberOf',
'email'=>'mail'
],
'username_field' => 'email',
Thanks a lot!
Sorry guys for not answering over a month..
Is the issue still present?
Hi @strebl, I'm trying to set this up with Laravel 5.1 and I'm getting a very similar error with:
ErrorException in LdapAuthUserProvider.php line 117: Undefined index: username
Is there something I'm missing or I should be doing here?
Scratch that, I needed to add a 'username' column to my database before it would correctly authenticate. It doesn't seem to ever 'touch' the table / database but appears it is required in order to actually authenticate; although I would like it to drop a reference to them into the database somehow.
@carrgilson @strebl I had the same problem in Laravel 5.1.
I replaced the hard coded username
with $this->getUsernameField()
inside the method \Ccovey\LdapAuth\LdapAuthUserProvider::validateCredentials
.
public function validateCredentials(UserContract $user, array $credentials)
{
return $this->ad->authenticate($credentials[$this->getUsernameField()], $credentials['password']);
}
I get this error: ErrorException in LdapAuthUserProvider.php line 117: Undefined index: fieldname
my files
config/auth.php
config/adlap.php
/routes.php Route::get('auth/login', 'Auth\AuthController@getLogin'); Route::post('auth/login', ['as' =>'auth/login', 'uses' => 'Auth\AuthController@postLogin']);
//AuthController.php
I do wrong?