OAuthStorageAbstract
in package
implements
OAuthStorageInterface
AbstractYes
Implements an abstract OAuth storage adapter
Table of Contents
Interfaces
- OAuthStorageInterface
- Specifies the methods required for an OAuth storage adapter
Constants
- ENCRYPT_FORMAT = \chillerlan\Utilities\Crypto::ENCRYPT_FORMAT_HEX
- Output format for encrypted data
- KEY_STATE = 'STATE'
- KEY_TOKEN = 'TOKEN'
- KEY_VERIFIER = 'VERIFIER'
Properties
- $logger : LoggerInterface
- A PSR-3 logger
- $options : OAuthOptions|SettingsContainerInterface
- The options instance
Methods
- __construct() : mixed
- OAuthStorageAbstract constructor.
- fromStorage() : AccessToken
- Retrieves token JOSN from the underlying storage engine and returns an AccessToken
- setLogger() : static
- Sets a logger. (LoggerAwareInterface is stupid)
- toStorage() : mixed
- Prepares an AccessToken for storage (serialize, encrypt etc.) and returns a value that is suited for the underlying storage engine
- decrypt() : string
- decrypts the given $encrypted data
- encrypt() : string
- encrypts the given $data
- getProviderName() : string
- Gets the current provider name
Constants
ENCRYPT_FORMAT
Output format for encrypted data
protected
int
ENCRYPT_FORMAT
= \chillerlan\Utilities\Crypto::ENCRYPT_FORMAT_HEX
KEY_STATE
protected
final mixed
KEY_STATE
= 'STATE'
KEY_TOKEN
protected
final mixed
KEY_TOKEN
= 'TOKEN'
KEY_VERIFIER
protected
final mixed
KEY_VERIFIER
= 'VERIFIER'
Properties
$logger
A PSR-3 logger
protected
LoggerInterface
$logger
$options
The options instance
protected
OAuthOptions|SettingsContainerInterface
$options
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()
fromStorage()
Retrieves token JOSN from the underlying storage engine and returns an AccessToken
public
fromStorage(mixed $data) : AccessToken
Parameters
- $data : mixed
Return values
AccessTokensetLogger()
Sets a logger. (LoggerAwareInterface is stupid)
public
setLogger(LoggerInterface $logger) : static
Parameters
- $logger : LoggerInterface
Tags
Return values
statictoStorage()
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
decrypt()
decrypts the given $encrypted data
protected
decrypt(string $encrypted) : string
Parameters
- $encrypted : string
Return values
stringencrypt()
encrypts the given $data
protected
encrypt(string $data) : string
Parameters
- $data : string
Return values
stringgetProviderName()
Gets the current provider name
protected
getProviderName(string $provider) : string
Parameters
- $provider : string