ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilAuthFrontendCredentialsSoap Class Reference
+ Inheritance diagram for ilAuthFrontendCredentialsSoap:
+ Collaboration diagram for ilAuthFrontendCredentialsSoap:

Public Member Functions

 __construct (ServerRequestInterface $httpRequest, ilCtrl $ctrl, ilSetting $settings)
 ilAuthFrontendCredentialsApache constructor. More...
 
 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
 
ilCtrl $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,
ilCtrl  $ctrl,
ilSetting  $settings 
)

ilAuthFrontendCredentialsApache constructor.

Parameters
ServerRequestInterface$httpRequest
ilCtrl$ctrl
ilSetting$settings

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

References $ctrl, $DIC, $httpRequest, $settings, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\logger(), and ILIAS\Repository\settings().

42  {
43  global $DIC;
44  $this->main_tpl = $DIC->ui()->mainTemplate();
45  $this->authSession = $DIC['ilAuthSession'];
46  $this->logger = $DIC->logger()->auth();
47  $this->httpRequest = $httpRequest;
48  $this->ctrl = $ctrl;
49  $this->settings = $settings;
51  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ 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 56 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.

56  : void
57  {
58  $cmd = '';
59  if (isset($this->httpRequest->getQueryParams()['cmd']) && is_string($this->httpRequest->getQueryParams()['cmd'])) {
60  $cmd = $this->httpRequest->getQueryParams()['cmd'];
61  }
62  if ('' === $cmd &&
63  isset($this->httpRequest->getParsedBody()['cmd']) && is_string($this->httpRequest->getParsedBody()['cmd'])) {
64  $cmd = $this->httpRequest->getParsedBody()['cmd'];
65  }
66 
67  $passedSso = '';
68  if (isset($this->httpRequest->getQueryParams()['passed_sso']) && is_string($this->httpRequest->getQueryParams()['passed_sso'])) {
69  $passedSso = $this->httpRequest->getQueryParams()['passed_sso'];
70  }
71 
72  if (!empty($passedSso)) {
73  return;
74  }
75 
76  if (!(bool) $this->settings->get('soap_auth_active', "")) {
77  return;
78  }
79 
80  if (empty($this->getUsername()) || empty($this->getPassword())) {
81  return;
82  }
83 
84  $this->logger->debug('Using SOAP authentication.');
85 
86  $status = ilAuthStatus::getInstance();
87 
88  $provider = new ilAuthProviderSoap($this);
89 
90  $frontend_factory = new ilAuthFrontendFactory();
91  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
92  $frontend = $frontend_factory->getFrontend(
93  $this->authSession,
94  $status,
95  $this,
96  [$provider]
97  );
98 
99  $frontend->authenticate();
100 
101  switch ($status->getStatus()) {
103  ilLoggerFactory::getLogger('auth')->debug(
104  'Redirecting to default starting page.'
105  );
107  break;
108 
110  $this->main_tpl->setOnScreenMessage('failure', $status->getTranslatedReason(), true);
111  $this->ctrl->redirectToURL(ilUtil::appendUrlParameterString(
112  $this->ctrl->getLinkTargetByClass('ilStartupGUI', 'showLoginPage', '', false, false),
113  'passed_sso=1'
114  ));
115  break;
116  }
117  }
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
Factory for auth frontend classes.
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

ilCtrl 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: