Skip to content

Commit

Permalink
Implemented retrieveById()
Browse files Browse the repository at this point in the history
Laravel 5 needs this method for successful authentication.
  • Loading branch information
Ole Bläsing committed Feb 26, 2015
1 parent 2f6046d commit 931b0dc
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Dsdevbe/LdapConnector/LdapUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@ public function __construct($config)
*/
public function retrieveById($identifier)
{
// TODO: Implement retrieveById() method.
$userInfo = $this->adldap->user()->info($identifier, array('*'))[0];

$credentials = array();
$credentials['username'] = $identifier;

foreach($userInfo as $key => $value){
$credentials[$key] = $value[0];
}

return new LdapUser($credentials);
}

/**
Expand Down Expand Up @@ -83,4 +92,4 @@ public function validateCredentials(Authenticatable $user, array $credentials)
return $this->adldap->authenticate($username, $password);
}

}
}

0 comments on commit 931b0dc

Please sign in to comment.