ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ILIAS\AuthShibboleth\LoginPerformer Class Reference
+ Collaboration diagram for ILIAS\AuthShibboleth\LoginPerformer:

Public Member Functions

 __construct (private ilLogger $logger, private ilCtrlInterface $ctrl, private ilGlobalTemplateInterface $template, private ilLanguage $lng, private ilAuthSession $auth_ession,)
 
 doShibbolethAuthentication ()
 

Detailed Description

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 38 of file LoginPerformer.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\AuthShibboleth\LoginPerformer::__construct ( private ilLogger  $logger,
private ilCtrlInterface  $ctrl,
private ilGlobalTemplateInterface  $template,
private ilLanguage  $lng,
private ilAuthSession  $auth_ession 
)

Definition at line 40 of file LoginPerformer.php.

46  {
47  }

Member Function Documentation

◆ doShibbolethAuthentication()

ILIAS\AuthShibboleth\LoginPerformer::doShibbolethAuthentication ( )

Definition at line 49 of file LoginPerformer.php.

References $provider, ilAuthUtils\AUTH_SHIBBOLETH, ilAuthFrontendFactory\CONTEXT_STANDARD_FORM, ILIAS\Repository\ctrl(), ilAuthStatus\getInstance(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ilInitialisation\redirectToStartingPage(), ilAuthStatus\STATUS_ACCOUNT_MIGRATION_REQUIRED, ilAuthStatus\STATUS_AUTHENTICATED, and ilAuthStatus\STATUS_AUTHENTICATION_FAILED.

49  : void
50  {
51  $this->logger->debug('Trying shibboleth authentication');
52 
53  $credentials = new ilAuthFrontendCredentialsShibboleth();
54  $credentials->initFromRequest();
55 
56  $provider_factory = new ilAuthProviderFactory();
57  $provider = $provider_factory->getProviderByAuthMode($credentials, ilAuthUtils::AUTH_SHIBBOLETH);
58 
59  $status = ilAuthStatus::getInstance();
60 
61  $frontend_factory = new ilAuthFrontendFactory();
62  $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
63  $frontend = $frontend_factory->getFrontend(
64  $this->auth_ession,
65  $status,
66  $credentials,
67  [$provider]
68  ) ?? throw new ilException('No frontend found');
69  $frontend->authenticate();
70 
71  switch ($status->getStatus()) {
73  $this->logger->debug('Authentication successful; Redirecting to starting page.');
75 
76  // no break
78  $this->ctrl->redirect($this, 'showAccountMigration');
79 
80  // no break
82  $this->template->setOnScreenMessage('failure', $status->getTranslatedReason(), true);
83  $this->ctrl->redirect($this, 'showLoginPage');
84  }
85 
86  $this->template->setOnScreenMessage('failure', $this->lng->txt('err_wrong_login'), true);
87  $this->ctrl->setTargetScript('ilias.php');
88  $this->ctrl->redirectByClass(ilStartUpGUI::class, 'showLoginPage');
89  }
const int AUTH_SHIBBOLETH
const int STATUS_AUTHENTICATED
$provider
Definition: ltitoken.php:80
const int STATUS_AUTHENTICATION_FAILED
const int CONTEXT_STANDARD_FORM
Authentication with id and password.
static redirectToStartingPage(string $target='')
static getInstance()
Get status instance.
const int STATUS_ACCOUNT_MIGRATION_REQUIRED
+ Here is the call graph for this function:

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