class Authentication extends JObject

Authentication class, provides an interface for the Joomla authentication system

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)

Methods

__construct()

Constructor

static  Authentication
getInstance()

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

mixed
getState()

Get the state of the Authentication object

void
attach( object $observer)

Attach an observer object

boolean
detach( object $observer)

Detach an observer object

authenticate( array $credentials, array $options = array())

Finds out if a set of login credentials are valid by asking all observing objects to run their respective authentication routines.

authorise( AuthenticationResponse $response, array $options = array())

Authorises that a particular user should be able to login

Details

__construct()

Constructor

static Authentication getInstance()

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

Return Value

Authentication The global Authentication object

mixed getState()

Get the state of the Authentication object

Return Value

mixed The state of the object.

void attach( object $observer)

Attach an observer object

Parameters

object $observer An observer object to attach

Return Value

void

boolean detach( object $observer)

Detach an observer object

Parameters

object $observer An observer object to detach.

Return Value

boolean True if the observer object was detached.

AuthenticationResponse authenticate( array $credentials, array $options = array())

Finds out if a set of login credentials are valid by asking all observing objects to run their respective authentication routines.

Parameters

array $credentials Array holding the user credentials.
array $options Array holding user options.

Return Value

AuthenticationResponse Response object with status variable filled in for last plugin or first successful plugin.

See also

AuthenticationResponse

static AuthenticationResponse[] authorise( AuthenticationResponse $response, array $options = array())

Authorises that a particular user should be able to login

Parameters

AuthenticationResponse $response response including username of the user to authorise
array $options list of options

Return Value

AuthenticationResponse[] Array of authentication response objects