19declare(strict_types=1);
41 $this->
ctrl = $DIC->ctrl();
42 $this->main_tpl =
$DIC->ui()->mainTemplate();
43 $this->auth_session =
$DIC[
'ilAuthSession'];
44 $this->
lng = $DIC->language();
45 $this->
logger = $DIC->logger()->forComponent(
'lti');
63 if ($this->
ctrl->getCmd() === self::CMD_AUTHENTICATE) {
67 $this->
ctrl->redirectByClass(ilStartUpGUI::class,
'showLoginPage');
72 $this->
logger->debug(
'Trying lti authentication');
75 $credentials->initFromRequest();
84 $frontend = $frontend_factory->getFrontend(
90 $frontend->authenticate();
93 if ($lti_target !==
'') {
97 switch ($status->getStatus()) {
101 if ($lti_target !==
'') {
102 $this->
ctrl->redirectToURL($lti_target);
104 $this->
logger->debug(
'Authentication successful; Redirecting to starting page.');
109 $this->
ctrl->redirectByClass(ilStartUpGUI::class,
'showAccountMigration');
113 $this->main_tpl->setOnScreenMessage(
'failure', $status->getTranslatedReason(),
true);
114 $this->
ctrl->redirectByClass(ilStartUpGUI::class,
'showLoginPage');
117 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_wrong_login'),
true);
The credentials of a launch: the id the platform gives the user.
const int CONTEXT_STANDARD_FORM
Authentication with id and password.
const int STATUS_AUTHENTICATION_FAILED
const int STATUS_ACCOUNT_MIGRATION_REQUIRED
const int STATUS_AUTHENTICATED
static getInstance()
Get status instance.
const int AUTH_PROVIDER_LTI
static redirectToStartingPage(string $target='')
Logs the user of a launch in, see lti.php.
getSafePostCommands()
A platform cannot send the token of ilCtrl.
readonly ilAuthSession $auth_session
readonly ilLogger $logger
readonly ilCtrlInterface $ctrl
const string CMD_AUTHENTICATE
readonly ilGlobalTemplateInterface $main_tpl
getUnsafeGetCommands()
This method must return a list of unsafe GET commands.
static allowCrossSite()
Sends the session cookie again as SameSite=None, with the path and the domain of the one PHP sends so...
static getLaunchTarget()
The address the user of an accepted launch goes on to: the object the platform launched,...
Component logger with individual log levels by component id.
static set(string $a_var, $a_val)
Set a value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...