credentials)) { $this->allowedCredentials = $config->credentials; } } public function hasUsername(Credentials $userCredentials) { foreach ($this->allowedCredentials as $credential) { if ($credential->getUsername() == $userCredentials->getUsername()) { return true; } } return false; } public static function getDummyUser() { return new User( "Username", "Firstname", "Lastname", "user@test.local" ); } public function authenticate(Credentials $credentials) { if (!in_array($credentials, $this->allowedCredentials)) { return false; } return self::getDummyUser(); } }