class SessionStateHandler in Auth0 Single Sign On 8.2
Session based implementation of StateHandler.
@author Auth0
Hierarchy
- class \Auth0\SDK\API\Helpers\State\SessionStateHandler implements StateHandler
Expanded class hierarchy of SessionStateHandler
Deprecated
5.7.0, replaced by Auth0\SDK\Helpers\TransientStoreHandler
3 files declare their use of SessionStateHandler
- Auth0.php in vendor/
auth0/ auth0-php/ src/ Auth0.php - AuthController.php in src/
Controller/ AuthController.php - Contains \Drupal\auth0\Controller\AuthController.
- SessionStateHandlerTest.php in vendor/
auth0/ auth0-php/ tests/ API/ Helpers/ State/ SessionStateHandlerTest.php
File
- vendor/
auth0/ auth0-php/ src/ API/ Helpers/ State/ SessionStateHandler.php, line 23
Namespace
Auth0\SDK\API\Helpers\StateView source
class SessionStateHandler implements StateHandler {
const STATE_NAME = 'webauth_state';
private $store;
/**
*
* @param StoreInterface $store
*/
public function __construct(StoreInterface $store) {
$this->store = $store;
}
/**
* Generate state value to be used for the state param value during authorization.
*
* @return string
*/
public function issue() {
$state = uniqid('', true);
$this
->store($state);
return $state;
}
/**
* Store a given state value to be used for the state param value during authorization.
*
* @param string $state
*
* @return mixed|void
*/
public function store($state) {
$this->store
->set(self::STATE_NAME, $state);
}
/**
* Perform validation of the returned state with the previously generated state.
*
* @param string $state
*
* @return boolean
*/
public function validate($state) {
$valid = $this->store
->get(self::STATE_NAME) == $state;
$this->store
->delete(self::STATE_NAME);
return $valid;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SessionStateHandler:: |
private | property | ||
SessionStateHandler:: |
public | function |
Generate state value to be used for the state param value during authorization. Overrides StateHandler:: |
|
SessionStateHandler:: |
constant | |||
SessionStateHandler:: |
public | function |
Store a given state value to be used for the state param value during authorization. Overrides StateHandler:: |
|
SessionStateHandler:: |
public | function |
Perform validation of the returned state with the previously generated state. Overrides StateHandler:: |
|
SessionStateHandler:: |
public | function |