Documentation

SessionStorage extends OAuthStorageAbstract
in package

Implements a session storage adapter.

Note: the session storage is only half persistent, as tokens are stored for the duration of the session.

Table of Contents

Properties

$logger  : LoggerInterface
$options  : OAuthOptions|SettingsContainerInterface
$stateVar  : string
the key name for the CSRF token storage array in $_SESSION
$tokenVar  : string
the key name for the token storage array in $_SESSION

Methods

__construct()  : mixed
OAuthStorageAbstract constructor.
__destruct()  : mixed
SessionStorage destructor.
clearAccessToken()  : static
clearAllAccessTokens()  : static
clearAllCSRFStates()  : static
clearCSRFState()  : static
construct()  : void
SessionStorage (pseudo-) constructor.
fromStorage()  : AccessToken
Retrieves token JOSN from the underlying storage engine and returns an AccessToken
getAccessToken()  : AccessToken
getCSRFState()  : string
hasAccessToken()  : bool
hasCSRFState()  : bool
setLogger()  : static
Sets a logger. (LoggerAwareInterface is stupid)
storeAccessToken()  : static
storeCSRFState()  : static
toStorage()  : mixed
Prepares an AccessToken for storage (serialize, encrypt etc.) and returns a value that is suited for the underlying storage engine
getServiceName()  : string
Gets the current service provider name

Properties

$stateVar

the key name for the CSRF token storage array in $_SESSION

protected string $stateVar

$tokenVar

the key name for the token storage array in $_SESSION

protected string $tokenVar

Methods

__construct()

OAuthStorageAbstract constructor.

public __construct([OAuthOptions|SettingsContainerInterface $options = new OAuthOptions() ][, LoggerInterface $logger = new NullLogger() ]) : mixed
Parameters
$options : OAuthOptions|SettingsContainerInterface = new OAuthOptions()
$logger : LoggerInterface = new NullLogger()

__destruct()

SessionStorage destructor.

public __destruct() : mixed
Tags
codeCoverageIgnore

clearAccessToken()

public clearAccessToken(string $service) : static
Parameters
$service : string
Tags
inheritDoc
Return values
static

clearAllAccessTokens()

public clearAllAccessTokens() : static
Tags
inheritDoc
Return values
static

clearAllCSRFStates()

public clearAllCSRFStates() : static
Tags
inheritDoc
Return values
static

clearCSRFState()

public clearCSRFState(string $service) : static
Parameters
$service : string
Tags
inheritDoc
Return values
static

construct()

SessionStorage (pseudo-) constructor.

public construct() : void

fromStorage()

Retrieves token JOSN from the underlying storage engine and returns an AccessToken

public fromStorage(mixed $data) : AccessToken
Parameters
$data : mixed
Tags
inheritDoc
Return values
AccessToken

getCSRFState()

public getCSRFState(string $service) : string
Parameters
$service : string
Tags
inheritDoc
Return values
string

hasAccessToken()

public hasAccessToken(string $service) : bool
Parameters
$service : string
Tags
inheritDoc
Return values
bool

hasCSRFState()

public hasCSRFState(string $service) : bool
Parameters
$service : string
Tags
inheritDoc
Return values
bool

setLogger()

Sets a logger. (LoggerAwareInterface is stupid)

public setLogger(LoggerInterface $logger) : static
Parameters
$logger : LoggerInterface
Tags
inheritDoc
codeCoverageIgnore
Return values
static

storeAccessToken()

public storeAccessToken(AccessToken $token, string $service) : static
Parameters
$token : AccessToken
$service : string
Tags
inheritDoc
Return values
static

storeCSRFState()

public storeCSRFState(string $state, string $service) : static
Parameters
$state : string
$service : string
Tags
inheritDoc
Return values
static

toStorage()

Prepares an AccessToken for storage (serialize, encrypt etc.) and returns a value that is suited for the underlying storage engine

public toStorage(AccessToken $token) : mixed
Parameters
$token : AccessToken
Tags
inheritDoc

        
On this page

Search results