Abstract authentication base.

package XenForo_Authentication

 Methods

Perform authentication against the given password

authenticate(integer $userId, string $password) : bool

Parameters

$userId

integer

The user ID we're trying to authenticate as. This may not be needed, but can be used to "upgrade" auth schemes.

$password

string

Password (plain text)

Returns

boolTrue if the authentication is successful

Factory method to get the named authentication module.

create(string $class) : \XenForo_Authentication_Abstract

The class must exist or be autoloadable or an exception will be thrown.

Parameters

$class

string

Class to load

Returns

Factory method to create the default authentication handler.

createDefault() : \XenForo_Authentication_Abstract

Generate new authentication data for the given password

generate(string $password) : false | string

Parameters

$password

string

Password (plain text)

Returns

falsestringThe result will be stored in a binary result

Generates an arbtirary length salt

generateSalt($length) : string

Parameters

$length

Returns

string

Returns the name of the authentication class being used.

getClassName() : string

Returns

string

Returns true if the auth method provides a password.

hasPassword() : boolean

A user can switch away from this auth by requesting a password be emailed to him/her. An example of this situation is FB registrations.

Returns

boolean

Initialize data for the authentication object.

setData(string $data) 

Parameters

$data

string

Binary data from the database

 Constants

 

Default Salt Length

DEFAULT_SALT_LENGTH : integer