ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilAuthFrontendHTTP.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once './Services/Authentication/classes/Frontend/class.ilAuthFrontend.php';
6include_once './Services/Authentication/interfaces/interface.ilAuthFrontendInterface.php';
7
15{
16 public function authenticate()
17 {
18 foreach ($this->getProviders() as $provider) {
19 $this->resetStatus();
20
21 $this->getLogger()->debug('Trying authentication against: ' . get_class($provider));
22
23 $provider->doAuthentication($this->getStatus());
24
25 $this->getLogger()->debug('Authentication user id: ' . $this->getStatus()->getAuthenticatedUserId());
26
27 switch ($this->getStatus()->getStatus()) {
29 return $this->handleAuthenticationSuccess($provider);
30
32 $this->getLogger()->notice("Account migration required.");
33 break;
34
36 default:
37 $this->getLogger()->debug('Authentication failed against: ' . get_class($provider));
38 break;
39 }
40 }
41 return $this->handleAuthenticationFail();
42 }
43
47 protected function handleAuthenticationFail()
48 {
49 header("WWW-Authenticate: Basic realm=\"" . CLIENT_ID . "\"");
50 header('HTTP/1.0 401 Unauthorized');
51 }
52}
An exception for terminatinating execution or to throw for unit testing.
Description of class class.
authenticate()
Try to authenticate user.
handleAuthenticationFail()
Draw basic auth.
Description of class class.
resetStatus()
Reset status.
getLogger()
Get logger.
getProviders()
Get providers.
handleAuthenticationSuccess(ilAuthProviderInterface $provider)
Handle successful authentication.
const STATUS_AUTHENTICATION_FAILED
const STATUS_ACCOUNT_MIGRATION_REQUIRED
Interface for auth methods (web form, http, ...)