ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilAuthFrontendCredentialsLTI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
28{
29 public function __construct()
30 {
32 // overwrite default lti logger
33 // $this->setLogger($GLOBALS['DIC']->logger()->lti());
34 }
35
36
37
41 public function initFromRequest(): void
42 {
43 global $DIC;
45 $logger->debug('New lti authentication request...');
46 $user_id = '';
47 if ($DIC->http()->wrapper()->post()->has('login_hint')) {
48 $logger->debug('LTI 1.3 initiate login...');
49 $user_id = $DIC->http()->wrapper()->post()->retrieve('login_hint', $DIC->refinery()->kindlyTo()->string());
50 ilSession::set("lti13_initiate_login", $user_id);
51 }
52 if ($DIC->http()->wrapper()->post()->has('user_id')) {
53 $user_id = $DIC->http()->wrapper()->post()->retrieve('user_id', $DIC->refinery()->kindlyTo()->string());
54 }
55 if (empty($user_id) && ilSession::has("lti13_initiate_login")) {
56 $user_id = ilSession::get("lti13_initiate_login");
57 ilSession::clear("lti13_initiate_login");
58 }
59 // ToDo: Error Handling
60 // if (empty($user_id)) {}
61 $this->setUsername($user_id);
62 }
63}
Auth credentials for lti oauth based authentication.
initFromRequest()
Init credentials from request.
static getLogger(string $a_component_id)
Get component logger.
debug(string $message, array $context=[])
static get(string $a_var)
static clear(string $a_var)
static set(string $a_var, $a_val)
Set a value.
static has($a_var)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26