An authentication adapter for AuthComponent. Provides the ability to authenticate using POST data using Blowfish hashing. Can be used by configuring AuthComponent to use it via the AuthComponent::$authenticate setting.
$this->Auth->authenticate = array( 'Blowfish' => array( 'scope' => array('User.active' => 1) ) )
When configuring BlowfishAuthenticate you can pass in settings to which fields, model and additional conditions are used. See FormAuthenticate::$settings for more information.
For initial password hashing/creation see Security::hash(). Other than how the password is initially hashed, BlowfishAuthenticate works exactly the same way as FormAuthenticate.
Since: CakePHP(tm) v 2.3
Deprecated: 3.0.0 Since 2.4. Just use FormAuthenticate with 'passwordHasher' setting set to 'Blowfish'
Copyright: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
License: MIT License
__construct() public deprecatedConstructor. Sets default passwordHasher to Blowfish
__construct() public deprecated ¶
ComponentCollection $collection , array $settings )
Methods inherited from FormAuthenticate
_checkFields() protected ¶
CakeRequest $request , string $model , array $fields )
Checks the fields to ensure they are supplied.
- The request that contains login information.
- string $model
- The model used for login verification.
- array $fields
- The fields to be checked.
False if the fields have not been supplied. True if they exist.
authenticate() public ¶
Authenticates the identity contained in a request. Will use the
to find POST data that is used to find a matching record in the
settings.userModel. Will return false if
there is no post data, either username or password is missing, or if the scope conditions have not been met.
False on login failure. An array of User data on success.
Methods inherited from BaseAuthenticate
_findUser() protected ¶
_findUser( string|array $username , string $password = null )
Find a user record using the standard options.
The $username parameter can be a (string)username or an array containing conditions for Model::find('first'). If the $password param is not provided the password field will be present in returned array.
Input passwords will be hashed even when a user doesn't exist. This helps mitigate timing attacks that are attempting to find valid usernames.
- string|array $username
- The username/identifier, or an array of find conditions.
- string $password optional null
- The password, only used if $username param is string.
Either false on failure, or an array of user data.
_password() protected deprecated ¶
_password( string $password )
Hash the plain text password so that it matches the hashed/encrypted password in the datasource.
- string $password
- The plain text password.
The hashed form of the password.
CakeRequest $request )
Get a user based on information in the request. Primarily used by stateless authentication systems like basic and digest auth.
- Request object.
Either false or an array of user information
implementedEvents() public ¶
of events => callbacks.
logout( array $user )
Allows you to hook into AuthComponent::logout(), and implement specialized logout behavior.
All attached authentication objects will have this method called when a user logs out.
- array $user
- The user about to be logged out.
passwordHasher() public ¶