ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilAuthFrontendCredentialsLTI Class Reference

Auth credentials for lti oauth based authentication. 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

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, $user_id, 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.
global $DIC
Definition: shib_login.php:22
static has($a_var)
setUsername(string $a_name)
Set username.
debug(string $message, array $context=[])
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: