PHP Класс ADmad\HybridAuth\Auth\HybridAuthAuthenticate

Licensed under The MIT License For full copyright and license information, please see the LICENSE.txt
Наследование: extends Cake\Auth\BaseAuthenticate, use trait Cake\Event\EventDispatcherTrait
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$_adapter Hybrid_Provider_Model HybridAuth adapter.
$_initDone boolean Whether hybrid auth intialization is done.
$_profileModel Cake\Datasource\RepositoryInterface Social profile model
$_providerProfile Hybrid_User_Profile HybridAuth user profile.
$_userModel Cake\Datasource\RepositoryInterface User model.

Открытые методы

Метод Описание
__construct ( Cake\Controller\ComponentRegistry $registry, array $config ) Constructor
adapter ( Hybrid_Provider_Model $adapter = null ) : Hybrid_Provider_Model | void Get / set hybridauth adapter instance.
authenticate ( Cake\Network\Request $request, Response $response ) : array | boolean Authenticate a user based on the request information.
getUser ( Cake\Network\Request $request ) : array | boolean Check if a provider is already connected, return user record if available.
implementedEvents ( ) : array Returns a list of all events that this authenticate class will listen to.
logout ( Cake\Event\Event $event, array $user ) : void Logout all providers
profile ( Hybrid_User_Profile $profile = null ) : Hybrid_User_Profile | void Get / set hybridauth user profile instance.

Защищенные методы

Метод Описание
_checkProvider ( array $data ) : string | boolean Checks whether provider is supplied.
_getUser ( Hybrid_Provider_Model $adapter ) : array Get user record for HybridAuth adapter and try to get associated user record from your application's database.
_init ( Cake\Network\Request $request ) : void Initialize HybridAuth and this authenticator.
_newUser ( Cake\ORM\Entity $profile ) : Cake\ORM\Entity Get new user entity.
_profileEntity ( Cake\ORM\Entity $profile = null ) : Cake\ORM\Entity Get social profile entity
_query ( string $identifier ) : Query Get query to fetch social profile record.

Описание методов

__construct() публичный метод

Constructor
public __construct ( Cake\Controller\ComponentRegistry $registry, array $config )
$registry Cake\Controller\ComponentRegistry The Component registry used on this request.
$config array Array of config to use.

_checkProvider() защищенный метод

Checks whether provider is supplied.
protected _checkProvider ( array $data ) : string | boolean
$data array Data array to check.
Результат string | boolean Provider name if it exists, false if required fields have not been supplied.

_getUser() защищенный метод

If app user record is not found a 'HybridAuth.newUser' event is dispatched with profile info from HyridAuth. The event listener should create associated user record and return user entity as event result.
protected _getUser ( Hybrid_Provider_Model $adapter ) : array
$adapter Hybrid_Provider_Model Hybrid auth adapter instance.
Результат array User record

_init() защищенный метод

Initialize HybridAuth and this authenticator.
protected _init ( Cake\Network\Request $request ) : void
$request Cake\Network\Request Request instance.
Результат void

_newUser() защищенный метод

It dispatches a HybridAuth.newUser event. A listener must return an entity for new user record.
protected _newUser ( Cake\ORM\Entity $profile ) : Cake\ORM\Entity
$profile Cake\ORM\Entity Social profile entity.
Результат Cake\ORM\Entity User entity.

_profileEntity() защищенный метод

Get social profile entity
protected _profileEntity ( Cake\ORM\Entity $profile = null ) : Cake\ORM\Entity
$profile Cake\ORM\Entity Social profile entity
Результат Cake\ORM\Entity

_query() защищенный метод

Get query to fetch social profile record.
protected _query ( string $identifier ) : Query
$identifier string Provider's identifier.
Результат Cake\ORM\Query

adapter() публичный метод

Get / set hybridauth adapter instance.
public adapter ( Hybrid_Provider_Model $adapter = null ) : Hybrid_Provider_Model | void
$adapter Hybrid_Provider_Model Hybrid auth adapter instance
Результат Hybrid_Provider_Model | void

authenticate() публичный метод

Authenticate a user based on the request information.
public authenticate ( Cake\Network\Request $request, Response $response ) : array | boolean
$request Cake\Network\Request Request to get authentication information from.
$response Cake\Network\Response A response object that can have headers added.
Результат array | boolean User array on success, false on failure.

getUser() публичный метод

Check if a provider is already connected, return user record if available.
public getUser ( Cake\Network\Request $request ) : array | boolean
$request Cake\Network\Request Request instance.
Результат array | boolean User array on success, false on failure.

implementedEvents() публичный метод

Returns a list of all events that this authenticate class will listen to.
public implementedEvents ( ) : array
Результат array List of events this class listens to.

logout() публичный метод

Logout all providers
public logout ( Cake\Event\Event $event, array $user ) : void
$event Cake\Event\Event Event.
$user array The user about to be logged out.
Результат void

profile() публичный метод

Get / set hybridauth user profile instance.
public profile ( Hybrid_User_Profile $profile = null ) : Hybrid_User_Profile | void
$profile Hybrid_User_Profile Hybrid auth user profile instance
Результат Hybrid_User_Profile | void

Описание свойств

$_adapter защищенное свойство

HybridAuth adapter.
protected Hybrid_Provider_Model $_adapter
Результат Hybrid_Provider_Model

$_initDone защищенное свойство

Whether hybrid auth intialization is done.
protected bool $_initDone
Результат boolean

$_profileModel защищенное свойство

Social profile model
protected RepositoryInterface,Cake\Datasource $_profileModel
Результат Cake\Datasource\RepositoryInterface

$_providerProfile защищенное свойство

HybridAuth user profile.
protected Hybrid_User_Profile $_providerProfile
Результат Hybrid_User_Profile

$_userModel защищенное свойство

User model.
protected RepositoryInterface,Cake\Datasource $_userModel
Результат Cake\Datasource\RepositoryInterface