Authentication
Authentication class, provides an interface for the Joomla authentication system
| since |
1.7.0 |
|---|---|
| package |
Joomla CMS |
Methods
__construct
Constructor
__construct( pluginType = 'authentication', \Joomla\Event\DispatcherInterface dispatcher = null) :
| since |
1.7.0 |
|---|
Arguments
- pluginType
stringThe plugin type to run authorisation and authentication on- dispatcher
DispatcherInterface|nullThe event dispatcher we're going to use
Response
mixed
authenticate
Finds out if a set of login credentials are valid by asking all observing objects to run their respective authentication routines.
authenticate(mixed||string|int credentials, mixed||string|int options = []) : \Joomla\CMS\Authentication\AuthenticationResponse
| see | AuthenticationResponse |
|---|---|
| since |
1.7.0 |
Arguments
- credentials
array<string|int, mixed>Array holding the user credentials.- options
array<string|int, mixed>Array holding user options.
Response
AuthenticationResponseResponse object with status variable filled in for last plugin or first successful plugin.
authorise
Authorises that a particular user should be able to login
authorise(\Joomla\CMS\Authentication\AuthenticationResponse response, mixed||string|int options = []) : \Joomla\CMS\Authentication\AuthenticationResponse||string|int
| since |
1.7.0 |
|---|---|
| throws |
|
Arguments
- response
AuthenticationResponseresponse including username of the user to authorise- options
array<string|int, mixed>list of options
Response
array<string|int, AuthenticationResponse>Array of authentication response objects
getInstance
Returns the global authentication object, only creating it if it doesn't already exist.
getInstance( pluginType = 'authentication') : \Joomla\CMS\Authentication\Authentication
| since |
1.7.0 |
|---|
Arguments
- pluginType
stringThe plugin type to run authorisation and authentication on
Response
AuthenticationThe global Authentication object
Constants
STATUS_SUCCESS
This is the status code returned when the authentication is success (permit login)
| Value | 1 |
|---|---|
| since |
1.7.0 |
Type(s)
int
STATUS_CANCEL
Status to indicate cancellation of authentication (unused)
| Value | 2 |
|---|---|
| since |
1.7.0 |
Type(s)
int
STATUS_FAILURE
This is the status code returned when the authentication failed (prevent login if no success)
| Value | 4 |
|---|---|
| since |
1.7.0 |
Type(s)
int
STATUS_EXPIRED
This is the status code returned when the account has expired (prevent login)
| Value | 8 |
|---|---|
| since |
1.7.0 |
Type(s)
int
STATUS_DENIED
This is the status code returned when the account has been denied (prevent login)
| Value | 16 |
|---|---|
| since |
1.7.0 |
Type(s)
int
STATUS_UNKNOWN
This is the status code returned when the account doesn't exist (not an error)
| Value | 32 |
|---|---|
| since |
1.7.0 |
Type(s)
int
Properties
instance
JAuthentication instances container.
pluginType
Plugin Type to run
| since |
4.0.0 |
|---|
Type(s)
string