ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilAuthProvider.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
27 abstract class ilAuthProvider implements ilAuthProviderInterface
28 {
29  private const STATUS_UNDEFINED = 0;
30  private const STATUS_AUTHENTICATION_SUCCESS = 1;
31  private const STATUS_AUTHENTICATION_FAILED = 2;
32  private const STATUS_MIGRATION = 3;
33 
34 
35  private ilLogger $logger;
36 
38 
39  private int $status = self::STATUS_UNDEFINED;
40  private int $user_id = 0;
44  public function __construct(ilAuthCredentials $credentials)
45  {
46  global $DIC;
47  $this->logger = $DIC->logger()->auth();
48  $this->credentials = $credentials;
49  }
50 
55  public function getLogger(): ilLogger
56  {
57  return $this->logger;
58  }
59 
63  public function getCredentials(): ilAuthCredentials
64  {
65  return $this->credentials;
66  }
67 
71  protected function handleAuthenticationFail(ilAuthStatus $status, string $a_reason): bool
72  {
74  $status->setReason($a_reason);
75  return false;
76  }
77 }
Interface of auth credentials.
const STATUS_AUTHENTICATION_FAILED
global $DIC
Definition: feed.php:28
handleAuthenticationFail(ilAuthStatus $status, string $a_reason)
Handle failed authentication.
Base class for authentication providers (ldap, apache, ...)
Standard interface for auth provider implementations.
setStatus(int $a_status)
Set auth status.
ilAuthCredentials $credentials
getLogger()
Get logger.
setReason(string $a_reason)
Set reason.
Auth status implementation.
__construct(ilAuthCredentials $credentials)
Constructor.