Authentication

Extends \JObject

Authentication class, provides an interface for the Joomla authentication system

since

1.7.0

Methods

__construct

Constructor

__construct() 
since

1.7.0

attach

Attach an observer object

attach(object $observer) : void
since

1.7.0

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

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

1.7.0

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

1.7.0

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

1.7.0

Response

\Joomla\CMS\Authentication\AuthenticationThe global Authentication object

getState

Get the state of the Authentication object

getState() : mixed
since

1.7.0

Response

mixedThe state of the 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)

integer

STATUS_CANCEL

Status to indicate cancellation of authentication (unused)

Value 2
since

1.7.0

Type(s)

integer

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)

integer

STATUS_EXPIRED

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

Value 8
since

1.7.0

Type(s)

integer

STATUS_DENIED

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

Value 16
since

1.7.0

Type(s)

integer

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)

integer

Properties

observers

An array of Observer objects to notify

since

3.0.0

Type(s)

array

state

The state of the observable object

since

3.0.0

Type(s)

mixed

methods

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

since

3.0.0

Type(s)

array

instance

Authentication instances container.

static