From 931b0dcbb93455e7d4e9bdb2220f600264c95b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Bl=C3=A4sing?= Date: Thu, 26 Feb 2015 15:16:53 +0100 Subject: [PATCH] Implemented retrieveById() Laravel 5 needs this method for successful authentication. --- src/Dsdevbe/LdapConnector/LdapUserProvider.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 +}