ILIAS  release_8 Revision v8.24
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 to authenticate user. 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...
 
 authenticate ()
 Try authentication. 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 
)
Parameters
ilAuthSession$session
ilAuthStatus$status
ilAuthCredentials$credentials
ilAuthProvider[]$providers

Reimplemented from ilAuthFrontend.

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

29 {
31
32 global $DIC;
33 $this->logger = $DIC->logger()->auth();
34 }
ilAuthCredentials $credentials
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$session

References ilAuthFrontend\$credentials, $DIC, ilAuthFrontend\$providers, $session, ilAuthFrontend\$status, ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\logger().

+ Here is the call graph for this function:

Member Function Documentation

◆ authenticate()

ilAuthFrontendHTTP::authenticate ( )

Try to authenticate user.

Reimplemented from ilAuthFrontend.

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

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 }
handleAuthenticationFail()
Draw basic auth.
resetStatus()
Reset status.
getProviders()
Get providers.
handleAuthenticationSuccess(ilAuthProviderInterface $provider)
Handle successful authentication.
const STATUS_AUTHENTICATION_FAILED
const STATUS_ACCOUNT_MIGRATION_REQUIRED
$provider
Definition: ltitoken.php:83

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.

+ Here is the call graph for this function:

◆ handleAuthenticationFail()

ilAuthFrontendHTTP::handleAuthenticationFail ( )
protected

Draw basic auth.

Reimplemented from ilAuthFrontend.

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

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

References CLIENT_ID.

Referenced by authenticate().

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