19declare(strict_types=1);
31 private readonly
string $client,
32 private readonly
string $username,
41 require_once __DIR__ .
'/../../../../../artifacts/bootstrap_default.php';
44 if ($authSession ===
null) {
46 $authSession =
$DIC[
'ilAuthSession'];
48 $this->auth_session = $authSession;
53 $credentials = new \ilAuthFrontendCredentials();
54 $credentials->setUsername($this->username);
58 $frontend_factory = new \ilAuthFrontendFactory();
61 $provider_factory = new \ilAuthProviderCliFactory();
63 $frontend = $frontend_factory->getFrontend(
67 $provider_factory->getProviders($credentials)
70 $frontend->authenticate();
72 switch ($status->getStatus()) {
73 case \ilAuthStatus::STATUS_AUTHENTICATED:
74 $this->is_authenticated =
true;
78 \ilInitialisation::initLanguage(
true);
82 case \ilAuthStatus::STATUS_AUTHENTICATION_FAILED:
90 if ($this->is_authenticated) {
92 $this->auth_session->logout();
readonly ilAuthSession $auth_session
__construct(private readonly string $client, private readonly string $username, ?\ilAuthSession $authSession=null)
static getInstance()
Get status instance.
static init(string $a_type)
Init context by type.
static getLogger(string $a_component_id)
Get component logger.
static setClosingContext(int $a_context)
set closing context (for statistics)
const int SESSION_CLOSE_USER
entry_point(string $name)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...