Elgg  Version 6.1
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 (protected 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

array $handlers = []
 

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 ( protected HandlersService  $handlerService)

Create new service.

Parameters
HandlersService$handlerServicehandler service

Definition at line 30 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 79 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 42 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 64 of file AuthenticationService.php.

Member Data Documentation

array Elgg\AuthenticationService::$handlers = []
protected

Definition at line 23 of file AuthenticationService.php.


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