diff --git a/src/Dsdevbe/LdapConnector/LdapUserProvider.php b/src/Dsdevbe/LdapConnector/LdapUserProvider.php index d20d257..d1136af 100755 --- a/src/Dsdevbe/LdapConnector/LdapUserProvider.php +++ b/src/Dsdevbe/LdapConnector/LdapUserProvider.php @@ -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); } /** @@ -83,4 +92,4 @@ public function validateCredentials(Authenticatable $user, array $credentials) return $this->adldap->authenticate($username, $password); } -} \ No newline at end of file +}