ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilAuthFrontendCredentialsLTI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilAuthFrontendCredentialsLTI:
+ Collaboration diagram for ilAuthFrontendCredentialsLTI:

Public Member Functions

 __construct ()
 
 initFromRequest ()
 Init credentials from request. More...
 
- Public Member Functions inherited from ilAuthFrontendCredentials
 __construct ()
 
 setUsername (string $a_name)
 Set username. More...
 
 getUsername ()
 Get username. More...
 
 setPassword (string $a_password)
 Set password. More...
 
 getPassword ()
 Get password. More...
 
 setAuthMode (string $a_auth_mode)
 Set auth mode. More...
 
 getAuthMode ()
 Get auth mode. More...
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Auth credentials for lti oauth based authentication

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 27 of file class.ilAuthFrontendCredentialsLTI.php.

Constructor & Destructor Documentation

◆ __construct()

ilAuthFrontendCredentialsLTI::__construct ( )

Definition at line 29 of file class.ilAuthFrontendCredentialsLTI.php.

References ILIAS\GlobalScreen\Provider\__construct().

30  {
32  // overwrite default lti logger
33 // $this->setLogger($GLOBALS['DIC']->logger()->lti());
34  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ initFromRequest()

ilAuthFrontendCredentialsLTI::initFromRequest ( )

Init credentials from request.

Definition at line 41 of file class.ilAuthFrontendCredentialsLTI.php.

References $DIC, ilAuthFrontendCredentials\$logger, ilSession\clear(), ilLogger\debug(), ilSession\get(), ilLoggerFactory\getLogger(), ilSession\has(), ilSession\set(), and ilAuthFrontendCredentials\setUsername().

41  : 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  }
static get(string $a_var)
static getLogger(string $a_component_id)
Get component logger.
debug(string $a_message, array $a_context=array())
global $DIC
Definition: feed.php:28
static has($a_var)
setUsername(string $a_name)
Set username.
static clear(string $a_var)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: