ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
5 include_once './Services/Authentication/classes/Frontend/class.ilAuthFrontend.php';
6 include_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 }
Description of class class.
getProviders()
Get providers.
Description of class class.
const STATUS_AUTHENTICATION_FAILED
handleAuthenticationSuccess(ilAuthProviderInterface $provider)
Handle successful authentication.
resetStatus()
Reset status.
getLogger()
Get logger.
Interface for auth methods (web form, http, ...)
authenticate()
Try authentication.
Add a drawing to the header
Definition: 04printing.php:69
handleAuthenticationFail()
Draw basic auth.
const STATUS_ACCOUNT_MIGRATION_REQUIRED