request->getRemoteUser(); if (! empty($username)) { $client = LdapClient::connect(); $user = LdapUser::getUser($client, $username); if ($user === null) { $this->logger->info('User not found in LDAP server'); return false; } if ($user->getUsername() === '') { throw new LogicException('Username not found in LDAP profile, check the parameter LDAP_USER_ATTRIBUTE_USERNAME'); } $this->userInfo = $user; return true; } } catch (LdapException $e) { $this->logger->error($e->getMessage()); } return false; } }