ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilAuthFrontendHTTP Class Reference
+ Inheritance diagram for ilAuthFrontendHTTP:
+ Collaboration diagram for ilAuthFrontendHTTP:

Public Member Functions

 __construct (ilAuthSession $session, ilAuthStatus $status, ilAuthCredentials $credentials, array $providers)
 
 authenticate ()
 
- Public Member Functions inherited from ilAuthFrontend
 __construct (ilAuthSession $session, ilAuthStatus $status, ilAuthCredentials $credentials, array $providers)
 
 getAuthSession ()
 
 getCredentials ()
 
 getProviders ()
 
 getStatus ()
 
 resetStatus ()
 
 migrateAccount (ilAuthSession $session)
 
 migrateAccountNew ()
 
 authenticate ()
 

Protected Member Functions

 handleAuthenticationFail ()
 
- Protected Member Functions inherited from ilAuthFrontend
 handleAccountMigration (ilAuthProviderAccountMigrationInterface $provider)
 
 handleAuthenticationSuccess (ilAuthProviderInterface $provider)
 
 checkActivation (ilObjUser $user)
 
 checkExceededLoginAttempts (ilObjUser $user)
 
 checkTimeLimit (ilObjUser $user)
 
 checkIp (ilObjUser $user)
 
 checkSimultaneousLogins (ilObjUser $user)
 
 handleAuthenticationFail ()
 
 handleLoginAttempts ()
 

Private Attributes

ilLogger $logger
 

Additional Inherited Members

- Data Fields inherited from ilAuthFrontend
const string MIG_EXTERNAL_ACCOUNT = 'mig_ext_account'
 
const string MIG_TRIGGER_AUTHMODE = 'mig_trigger_auth_mode'
 
const string MIG_DESIRED_AUTHMODE = 'mig_desired_auth_mode'
 

Detailed Description

Definition at line 21 of file class.ilAuthFrontendHTTP.php.

Constructor & Destructor Documentation

◆ __construct()

ilAuthFrontendHTTP::__construct ( ilAuthSession  $session,
ilAuthStatus  $status,
ilAuthCredentials  $credentials,
array  $providers 
)
Parameters
list<ilAuthProviderInterface>$providers

Definition at line 28 of file class.ilAuthFrontendHTTP.php.

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

33  {
34  parent::__construct($session, $status, $credentials, $providers);
35 
36  global $DIC;
37  $this->logger = $DIC->logger()->auth();
38  }
global $DIC
Definition: shib_login.php:26
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ authenticate()

ilAuthFrontendHTTP::authenticate ( )

Implements ilAuthFrontendInterface.

Definition at line 40 of file class.ilAuthFrontendHTTP.php.

References $provider, ilAuthFrontend\getProviders(), ilAuthFrontend\getStatus(), handleAuthenticationFail(), ilAuthFrontend\handleAuthenticationSuccess(), ILIAS\Repository\logger(), ilAuthFrontend\resetStatus(), ilAuthStatus\STATUS_ACCOUNT_MIGRATION_REQUIRED, ilAuthStatus\STATUS_AUTHENTICATED, and ilAuthStatus\STATUS_AUTHENTICATION_FAILED.

40  : bool
41  {
42  foreach ($this->getProviders() as $provider) {
43  $this->resetStatus();
44 
45  $this->logger->debug('Trying authentication against: ' . get_class($provider));
46 
47  $provider->doAuthentication($this->getStatus());
48 
49  $this->logger->debug('Authentication user id: ' . $this->getStatus()
50  ->getAuthenticatedUserId());
51 
52  switch ($this->getStatus()->getStatus()) {
54  return $this->handleAuthenticationSuccess($provider);
55 
57  $this->logger->notice('Account migration required.');
58  break;
59 
61  default:
62  $this->logger->debug('Authentication failed against: ' . get_class($provider));
63  break;
64  }
65  }
66  return $this->handleAuthenticationFail();
67  }
handleAuthenticationSuccess(ilAuthProviderInterface $provider)
const int STATUS_AUTHENTICATED
$provider
Definition: ltitoken.php:80
const int STATUS_AUTHENTICATION_FAILED
const int STATUS_ACCOUNT_MIGRATION_REQUIRED
+ Here is the call graph for this function:

◆ handleAuthenticationFail()

ilAuthFrontendHTTP::handleAuthenticationFail ( )
protected

Definition at line 69 of file class.ilAuthFrontendHTTP.php.

References CLIENT_ID, and ILIAS\UI\examples\Symbol\Glyph\Header\header().

Referenced by authenticate().

69  : bool
70  {
71  parent::handleAuthenticationFail();
72 
73  header('WWW-Authenticate: Basic realm="' . CLIENT_ID . '"');
74  header('HTTP/1.0 401 Unauthorized');
75  return false;
76  }
const CLIENT_ID
Definition: constants.php:41
header()
expected output: > ILIAS shows the rendered Component.
Definition: header.php:29
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $logger

ilLogger ilAuthFrontendHTTP::$logger
private

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


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