Class BaseAuthenticate
Base Authentication class with common methods and properties.
Direct Subclasses
Package: Cake\Controller\Component\Auth
Copyright: Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
License: License (http://www.opensource.org/licenses/mit-license.php)
Location: Cake/Controller/Component/Auth/BaseAuthenticate.php
Properties summary
- 
			$_CollectionprotectedA Component collection, used to get more components.
- 
			$settingspublicarraySettings for this object.
Method Summary
- 
			__construct() publicConstructor
- 
			_findUser() protectedFind a user record using the standard options.
- 
			_password() protectedHash the plain text password so that it matches the hashed/encrypted password in the datasource. 
- 
			authenticate() abstract publicAuthenticate a user based on the request information.
- 
			getUser() publicGet a user based on information in the request. Primarily used by stateless authentication systems like basic and digest auth. 
- 
			logout() publicAllows you to hook into AuthComponent::logout(), and implement specialized logout behavior. 
Method Detail
__construct() public ¶
__construct( ComponentCollection $collection , array $settings )
		
Constructor
Parameters
- 
						ComponentCollection$collection
- The Component collection used on this request.
- array $settings
- Array of settings to use.
_findUser() protected ¶
_findUser( string $username , string $password )
Find a user record using the standard options.
Parameters
- string $username
- The username/identifier.
- string $password
- The unhashed password.
Returns
Either false on failure, or an array of user data.
_password() protected ¶
_password( string $password )
Hash the plain text password so that it matches the hashed/encrypted password in the datasource.
Parameters
- string $password
- The plain text password.
Returns
The hashed form of the password.
authenticate() abstract public ¶
authenticate( CakeRequest $request , CakeResponse $response )
		
Authenticate a user based on the request information.
Parameters
- 
						CakeRequest$request
- Request to get authentication information from.
- 
						CakeResponse$response
- A response object that can have headers added.
Returns
Either false on failure, or an array of user data on success.
getUser() public ¶
getUser( CakeRequest $request )
		
Get a user based on information in the request. Primarily used by stateless authentication systems like basic and digest auth.
Parameters
- 
						CakeRequest$request
- Request object.
Returns
Either false or an array of user information
Properties detail
$settings ¶
Settings for this object.
- fieldsThe fields to use to identify a user by.
- userModelThe model name of the User, defaults to User.
- scopeAdditional conditions to use when looking up and authenticating users, i.e.- array('User.is_active' => 1).
- recursiveThe value of the recursive key passed to find(). Defaults to 0.
- containExtra models to contain and store in session.
array( 'fields' => array( 'username' => 'username', 'password' => 'password' ), 'userModel' => 'User', 'scope' => array(), 'recursive' => 0, 'contain' => null, )
