Authentication

Authentication class, provides an interface for the Joomla authentication system

since

1.7.0

package

Application

Methods

__construct

Constructor

__construct(string pluginType = 'authentication', \Joomla\Event\DispatcherInterface dispatcher = null) : mixed
since

1.7.0

Arguments

pluginType

stringThe plugin type to run authorisation and authentication on

dispatcher

\Joomla\Event\DispatcherInterfaceThe 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(array credentials, array options = array()) : \Joomla\CMS\Authentication\AuthenticationResponse
see AuthenticationResponse
since

1.7.0

Arguments

credentials

arrayArray holding the user credentials.

options

arrayArray holding user options.

Response

\Joomla\CMS\Authentication\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, array options = array()) : \Joomla\CMS\Authentication\AuthenticationResponse[]
since

1.7.0

throws

\Exception

Arguments

response

\Joomla\CMS\Authentication\AuthenticationResponseresponse including username of the user to authorise

options

arraylist of options

Response

\Joomla\CMS\Authentication\AuthenticationResponse[]Array of authentication response objects

getInstance

Returns the global authentication object, only creating it if it doesn't already exist.

getInstance(string pluginType = 'authentication') : \Joomla\CMS\Authentication\Authentication
static
since

1.7.0

Arguments

pluginType

stringThe plugin type to run authorisation and authentication on

Response

\Joomla\CMS\Authentication\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.

static
since

1.7.3

Type(s)

Authentication[]

pluginType

Plugin Type to run

since

4.0.0

Type(s)

string