ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 
17  public function authenticate()
18  {
19  foreach($this->getProviders() as $provider)
20  {
21  $this->resetStatus();
22 
23  $this->getLogger()->debug('Trying authentication against: ' . get_class($provider));
24 
25  $provider->doAuthentication($this->getStatus());
26 
27  $this->getLogger()->debug('Authentication user id: ' . $this->getStatus()->getAuthenticatedUserId());
28 
29  switch($this->getStatus()->getStatus())
30  {
32  return $this->handleAuthenticationSuccess($provider);
33 
35  $this->getLogger()->notice("Account migration required.");
36  break;
37 
39  default:
40  $this->getLogger()->debug('Authentication failed against: ' . get_class($provider));
41  break;
42  }
43  }
44  return $this->handleAuthenticationFail();
45  }
46 
50  protected function handleAuthenticationFail()
51  {
52  header("WWW-Authenticate: Basic realm=\"".CLIENT_ID."\"");
53  header('HTTP/1.0 401 Unauthorized');
54 
55  }
56 
57 
58 }
59 ?>
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