Authentication

Extends \JObject

Authentication class, provides an interface for the Joomla authentication system

since

11.1

Methods

__construct

Constructor

__construct() 
since

11.1

attach

Attach an observer object

attach(object $observer) : void
since

11.1

Arguments

$observer

objectAn observer object to attach

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

11.1

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()) : array<mixed,\Joomla\CMS\Authentication\AuthenticationResponse>
static
since

11.2

Arguments

$response

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

$options

arraylist of options

Response

array<mixed,\Joomla\CMS\Authentication\AuthenticationResponse>Array of authentication response objects

detach

Detach an observer object

detach(object $observer) : boolean
since

11.1

Arguments

$observer

objectAn observer object to detach.

Response

booleanTrue if the observer object was detached.

getInstance

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

getInstance() : \Joomla\CMS\Authentication\Authentication
static
since

11.1

Response

\Joomla\CMS\Authentication\AuthenticationThe global Authentication object

getState

Get the state of the Authentication object

getState() : mixed
since

11.1

Response

mixedThe state of the object.

Constants

STATUS_SUCCESS

This is the status code returned when the authentication is success (permit login)

STATUS_CANCEL

Status to indicate cancellation of authentication (unused)

STATUS_FAILURE

This is the status code returned when the authentication failed (prevent login if no success)

STATUS_EXPIRED

This is the status code returned when the account has expired (prevent login)

STATUS_DENIED

This is the status code returned when the account has been denied (prevent login)

STATUS_UNKNOWN

This is the status code returned when the account doesn't exist (not an error)

Properties

observers

An array of Observer objects to notify

Type(s)

array

state

The state of the observable object

Type(s)

mixed

methods

A multi dimensional array of [function][] = key for observers

Type(s)

array

instance

Authentication instances container.

static