radius = new Radius(Config::get('radius.hostname'), Config::get('radius.secret'), Config::get('radius.suffix'), Config::get('radius.timeout'), Config::get('radius.port')); } public function authenticate($credentials) { global $debug; if (empty($credentials['username'])) { throw new AuthenticationException('Username is required'); } if ($debug) { $this->radius->setDebug(true); } $password = $credentials['password'] ?? null; if ($this->radius->accessRequest($credentials['username'], $password) === true) { $this->addUser($credentials['username'], $password, Config::get('radius.default_level', 1)); return true; } throw new AuthenticationException(); } }