CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (GitHub)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • Slack
    • Paid Support
CakePHP

C CakePHP 2.3 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 2.3
      • 4.2
      • 4.1
      • 4.0
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Packages

  • Cake
    • Cache
      • Engine
    • Configure
    • Console
      • Command
        • Task
    • Controller
      • Component
        • Acl
        • Auth
    • Core
    • Error
    • Event
    • I18n
    • Log
      • Engine
    • Model
      • Behavior
      • Datasource
        • Database
        • Session
      • Validator
    • Network
      • Email
      • Http
    • Routing
      • Filter
      • Route
    • TestSuite
      • Coverage
      • Fixture
      • Reporter
    • Utility
    • View
      • Helper

Classes

  • ActionsAuthorize
  • BaseAuthenticate
  • BaseAuthorize
  • BasicAuthenticate
  • BlowfishAuthenticate
  • ControllerAuthorize
  • CrudAuthorize
  • DigestAuthenticate
  • FormAuthenticate

Class BlowfishAuthenticate

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.

BaseAuthenticate
Extended by FormAuthenticate
Extended by BlowfishAuthenticate
Package: Cake\Controller\Component\Auth
Since: CakePHP(tm) v 2.3
See: AuthComponent::$authenticate
Copyright: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
License: MIT License
Location: Cake/Controller/Component/Auth/BlowfishAuthenticate.php

Inherited Properties

  • _Collection, settings

Method Summary

  • authenticate() public

    Authenticates the identity contained in a request. Will use the settings.userModel, and settings.fields to find POST data that is used to find a matching record in thesettings.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.

Method Detail

authenticate() public ¶

authenticate( CakeRequest $request , CakeResponse $response )

Authenticates the identity contained in a request. Will use the settings.userModel, and settings.fields to find POST data that is used to find a matching record in thesettings.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.

Parameters
CakeRequest $request
The request that contains login information.
CakeResponse $response
Unused response object.
Returns
mixed
False on login failure. An array of User data on success.
Overrides
FormAuthenticate::authenticate()

Methods inherited from FormAuthenticate

_checkFields() protected ¶

_checkFields( CakeRequest $request , string $model , array $fields )

Checks the fields to ensure they are supplied.

Parameters
CakeRequest $request
The request that contains login information.
string $model
The model used for login verification.
array $fields
The fields to be checked.
Returns
boolean
False if the fields have not been supplied. True if they exist.

Methods inherited from BaseAuthenticate

__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( Mixed $conditions , Mixed $password = null )

Find a user record using the standard options.

The $conditions parameter can be a (string)username or an array containing conditions for Model::find('first'). If the password field is not included in the conditions the password will be returned.

Parameters
Mixed $conditions
The username/identifier, or an array of find conditions.
Mixed $password optional null
The password, only use if passing as $conditions = 'username'.
Returns
Mixed
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
string
The hashed form of the password.

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
mixed
Either false or an array of user information

logout() public ¶

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.

Parameters
array $user
The user about to be logged out.
OpenHub
Rackspace
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (GitHub)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • Slack
  • Paid Support

Generated using CakePHP API Docs