Elgg  Version 4.3
Public Member Functions | Protected Attributes | List of all members
Elgg\AuthenticationService Class Reference

Authentication service handles registration of PAM handlers and calling of those handlers. More...

Public Member Functions

 __construct (HandlersService $handlerService)
 Create new service. More...
 
 registerHandler ($handler, string $importance= 'sufficient', string $policy= 'user')
 Register an authentication handler. More...
 
 unregisterHandler ($handler, string $policy= 'user')
 Unregister an authentication handler. More...
 
 authenticate (string $policy, array $authentication_params=[])
 Authenticate. More...
 

Protected Attributes

 $handlers = []
 
 $handlerService
 

Detailed Description

Authentication service handles registration of PAM handlers and calling of those handlers.

Since
4.3

Definition at line 14 of file AuthenticationService.php.

Constructor & Destructor Documentation

Elgg\AuthenticationService::__construct ( HandlersService  $handlerService)

Create new service.

Parameters
HandlersService$handlerServicehandler service

Definition at line 35 of file AuthenticationService.php.

Member Function Documentation

Elgg\AuthenticationService::authenticate ( string  $policy,
array  $authentication_params = [] 
)

Authenticate.

Parameters
string$policyAuthentication policy (eg. 'user' or 'api')
array$authentication_params(optional) Credentials to use
Exceptions
AuthenticationException
Returns
bool

Definition at line 85 of file AuthenticationService.php.

Elgg\AuthenticationService::registerHandler (   $handler,
string  $importance = 'sufficient',
string  $policy = 'user' 
)

Register an authentication handler.

Parameters
callable$handlerA callable authentication handler
string$importanceThe importance of the authentication handler ('sufficient' or 'required')
string$policyThe policy for which the authentication handler can be used (eg. 'user' or 'api')
Returns
bool

Definition at line 48 of file AuthenticationService.php.

Elgg\AuthenticationService::unregisterHandler (   $handler,
string  $policy = 'user' 
)

Unregister an authentication handler.

Parameters
callable$handlerThe authentication handler to unregister
string$policyThe authentication handler policy
Returns
void

Definition at line 70 of file AuthenticationService.php.

Member Data Documentation

Elgg\AuthenticationService::$handlers = []
protected

Definition at line 23 of file AuthenticationService.php.

Elgg\AuthenticationService::$handlerService
protected

Definition at line 28 of file AuthenticationService.php.


The documentation for this class was generated from the following file: