ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilAuthFrontendCredentialsSoap Class Reference
+ Inheritance diagram for ilAuthFrontendCredentialsSoap:
+ Collaboration diagram for ilAuthFrontendCredentialsSoap:

Public Member Functions

 __construct (ServerRequestInterface $httpRequest, ilCtrlInterface $ctrl, ilSetting $settings)
 
 tryAuthenticationOnLoginPage ()
 Check if an authentication attempt should be done when login page has been called. 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...
 

Private Attributes

ServerRequestInterface $httpRequest
 
ilCtrlInterface $ctrl
 
ilSetting $settings
 
ilAuthSession $authSession
 
ilGlobalTemplateInterface $main_tpl
 
ilLogger $logger
 

Detailed Description

Definition at line 23 of file class.ilAuthFrontendCredentialsSoap.php.

Constructor & Destructor Documentation

◆ __construct()

ilAuthFrontendCredentialsSoap::__construct ( ServerRequestInterface  $httpRequest,
ilCtrlInterface  $ctrl,
ilSetting  $settings 
)

Definition at line 35 of file class.ilAuthFrontendCredentialsSoap.php.

References $ctrl, $DIC, $httpRequest, $settings, ILIAS\MetaData\Repository\Validation\Data\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\logger(), and ILIAS\Repository\settings().

36  {
37  global $DIC;
38  $this->main_tpl = $DIC->ui()->mainTemplate();
39  $this->authSession = $DIC['ilAuthSession'];
40  $this->logger = $DIC->logger()->auth();
41  $this->httpRequest = $httpRequest;
42  $this->ctrl = $ctrl;
43  $this->settings = $settings;
45  }
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ tryAuthenticationOnLoginPage()

ilAuthFrontendCredentialsSoap::tryAuthenticationOnLoginPage ( )

Check if an authentication attempt should be done when login page has been called.

Definition at line 50 of file class.ilAuthFrontendCredentialsSoap.php.

References $provider, ilUtil\appendUrlParameterString(), ilAuthFrontendFactory\CONTEXT_STANDARD_FORM, ILIAS\Repository\ctrl(), ilAuthStatus\getInstance(), ilLoggerFactory\getLogger(), ilAuthFrontendCredentials\getPassword(), ilAuthFrontendCredentials\getUsername(), ILIAS\Repository\logger(), ilInitialisation\redirectToStartingPage(), ILIAS\Repository\settings(), ilAuthStatus\STATUS_AUTHENTICATED, and ilAuthStatus\STATUS_AUTHENTICATION_FAILED.

50  : void
51  {
52  $cmd = '';
53  if (isset($this->httpRequest->getQueryParams()['cmd']) && is_string($this->httpRequest->getQueryParams()['cmd'])) {
54  $cmd = $this->httpRequest->getQueryParams()['cmd'];
55  }
56  if ('' === $cmd &&
57  isset($this->httpRequest->getParsedBody()['cmd']) && is_string($this->httpRequest->getParsedBody()['cmd'])) {
58  $cmd = $this->httpRequest->getParsedBody()['cmd'];
59  }
60 
61  $passedSso = '';
62  if (isset($this->httpRequest->getQueryParams()['passed_sso']) && is_string($this->httpRequest->getQueryParams()['passed_sso'])) {
63  $passedSso = $this->httpRequest->getQueryParams()['passed_sso'];
64  }
65 
66  if (!empty($passedSso)) {
67  return;
68  }
69 
70  if (!(bool) $this->settings->get('soap_auth_active', "")) {
71  return;
72  }
73 
74  if (empty($this->getUsername()) || empty($this->getPassword())) {
75  return;
76  }
77 
78  $this->logger->debug('Using SOAP authentication.');
79 
80  $status = ilAuthStatus::getInstance();
81 
82  $provider = new ilAuthProviderSoap($this);
83 
84  $frontend_factory = new ilAuthFrontendFactory();
85  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
86  $frontend = $frontend_factory->getFrontend(
87  $this->authSession,
88  $status,
89  $this,
90  [$provider]
91  );
92 
93  $frontend->authenticate();
94 
95  switch ($status->getStatus()) {
97  ilLoggerFactory::getLogger('auth')->debug(
98  'Redirecting to default starting page.'
99  );
101  break;
102 
104  $this->main_tpl->setOnScreenMessage('failure', $status->getTranslatedReason(), true);
105  $this->ctrl->redirectToURL(ilUtil::appendUrlParameterString(
106  $this->ctrl->getLinkTargetByClass('ilStartupGUI', 'showLoginPage', '', false, false),
107  'passed_sso=1'
108  ));
109  break;
110  }
111  }
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
static getLogger(string $a_component_id)
Get component logger.
const STATUS_AUTHENTICATION_FAILED
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilAuthProviderSoap.
$provider
Definition: ltitoken.php:83
static redirectToStartingPage(string $target='')
static getInstance()
Get status instance.
+ Here is the call graph for this function:

Field Documentation

◆ $authSession

ilAuthSession ilAuthFrontendCredentialsSoap::$authSession
private

Definition at line 31 of file class.ilAuthFrontendCredentialsSoap.php.

◆ $ctrl

ilCtrlInterface ilAuthFrontendCredentialsSoap::$ctrl
private

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

Referenced by __construct().

◆ $httpRequest

ServerRequestInterface ilAuthFrontendCredentialsSoap::$httpRequest
private

Definition at line 25 of file class.ilAuthFrontendCredentialsSoap.php.

Referenced by __construct().

◆ $logger

ilLogger ilAuthFrontendCredentialsSoap::$logger
private

Definition at line 33 of file class.ilAuthFrontendCredentialsSoap.php.

◆ $main_tpl

ilGlobalTemplateInterface ilAuthFrontendCredentialsSoap::$main_tpl
private

Definition at line 32 of file class.ilAuthFrontendCredentialsSoap.php.

◆ $settings

ilSetting ilAuthFrontendCredentialsSoap::$settings
private

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

Referenced by __construct().


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