19 declare(strict_types=1);
39 "Microsoft-WebDAV-MiniRedir",
52 foreach ($this->session_aware_webdav_clients as $webdav_client_name) {
53 if (stristr($user_agent, $webdav_client_name)) {
62 $user_agent =
$_SERVER[
"HTTP_USER_AGENT"] ??
"";
63 $user_agent = is_string($user_agent) ? $user_agent :
"";
68 public function authenticate(
string $a_username,
string $a_password): bool
71 if ($this->session->isAuthenticated()
72 && $this->
user->getId() !== 0
74 $this->
logger->debug(
'User authenticated through session. UserID = ' . $this->
user->getId());
82 $credentials->setUsername($a_username);
83 $credentials->setPassword($a_password);
86 $providers = $provider_factory->getProviders($credentials);
92 $frontend = $frontend_factory->getFrontend(
99 $frontend->authenticate();
101 switch ($status->getStatus()) {
104 'User authenticated through basic authentication. UserId = ' . $this->
user->getId()
109 $this->
logger->info(
'Basic authentication failed; Account migration required.');
113 $this->
logger->info(
'Basic authentication failed; Wrong login, password.');
static enableWebAccessWithoutSession(bool $enable_web_access_without_session)
isUserAgentSessionAware(string $user_agent)
const STATUS_AUTHENTICATION_FAILED
Factory for auth frontend classes.
__construct(protected ilObjUser $user, protected ilAuthSession $session, protected ilLogger $logger)
authenticate(string $a_username, string $a_password)
array $session_aware_webdav_clients
const STATUS_AUTHENTICATED
static getInstance()
Get status instance.
const STATUS_ACCOUNT_MIGRATION_REQUIRED