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

Public Member Functions

 __construct (ilAuthSession $session, ilAuthStatus $status, ilAuthCredentials $credentials, array $providers)
 
 authenticate ()
 Try authentication. More...
 
- Public Member Functions inherited from ilAuthFrontend
 __construct (ilAuthSession $session, ilAuthStatus $status, ilAuthCredentials $credentials, array $providers)
 
 getAuthSession ()
 Get auth session. More...
 
 getCredentials ()
 Get auth credentials. More...
 
 getProviders ()
 Get providers. More...
 
 getStatus ()
 
 resetStatus ()
 Reset status. More...
 
 migrateAccount (ilAuthSession $session)
 Migrate Account to existing user account. More...
 
 migrateAccountNew ()
 Create new user account. More...
 
 authenticate ()
 Try to authenticate user. More...
 

Protected Member Functions

 handleAuthenticationFail ()
 Draw basic auth. More...
 
- Protected Member Functions inherited from ilAuthFrontend
 handleAccountMigration (ilAuthProviderAccountMigrationInterface $provider)
 Handle account migration. More...
 
 handleAuthenticationSuccess (ilAuthProviderInterface $provider)
 Handle successful authentication. More...
 
 checkActivation (ilObjUser $user)
 Check activation. More...
 
 checkExceededLoginAttempts (ilObjUser $user)
 
 checkTimeLimit (ilObjUser $user)
 Check time limit. More...
 
 checkIp (ilObjUser $user)
 Check ip. More...
 
 checkSimultaneousLogins (ilObjUser $user)
 Check simultaneous logins. More...
 
 handleAuthenticationFail ()
 Handle failed authenication. More...
 

Private Attributes

ilLogger $logger
 

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilAuthFrontendHTTP::__construct ( ilAuthSession  $session,
ilAuthStatus  $status,
ilAuthCredentials  $credentials,
array  $providers 
)

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

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

29  {
30  parent::__construct($session, $status, $credentials, $providers);
31 
32  global $DIC;
33  $this->logger = $DIC->logger()->auth();
34  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ authenticate()

ilAuthFrontendHTTP::authenticate ( )

Try authentication.

Implements ilAuthFrontendInterface.

Definition at line 36 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.

36  : bool
37  {
38  foreach ($this->getProviders() as $provider) {
39  $this->resetStatus();
40 
41  $this->logger->debug('Trying authentication against: ' . get_class($provider));
42 
43  $provider->doAuthentication($this->getStatus());
44 
45  $this->logger->debug('Authentication user id: ' . $this->getStatus()
46  ->getAuthenticatedUserId());
47 
48  switch ($this->getStatus()->getStatus()) {
50  return $this->handleAuthenticationSuccess($provider);
51 
53  $this->logger->notice("Account migration required.");
54  break;
55 
57  default:
58  $this->logger->debug('Authentication failed against: ' . get_class($provider));
59  break;
60  }
61  }
62  return $this->handleAuthenticationFail();
63  }
getProviders()
Get providers.
const STATUS_AUTHENTICATION_FAILED
handleAuthenticationSuccess(ilAuthProviderInterface $provider)
Handle successful authentication.
resetStatus()
Reset status.
$provider
Definition: ltitoken.php:83
handleAuthenticationFail()
Draw basic auth.
const STATUS_ACCOUNT_MIGRATION_REQUIRED
+ Here is the call graph for this function:

◆ handleAuthenticationFail()

ilAuthFrontendHTTP::handleAuthenticationFail ( )
protected

Draw basic auth.

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

References CLIENT_ID.

Referenced by authenticate().

68  : bool
69  {
70  header("WWW-Authenticate: Basic realm=\"" . CLIENT_ID . "\"");
71  header('HTTP/1.0 401 Unauthorized');
72  return false;
73  }
const CLIENT_ID
Definition: constants.php:41
+ Here is the caller graph for this function:

Field Documentation

◆ $logger

ilLogger ilAuthFrontendHTTP::$logger
private

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


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