OAuthStorageInterface
in
Specifies the methods required for an OAuth token storage adapter
The token storage is intended to be invoked per-user, for whom it can store tokens for any of the implemented providers.
The implementer must ensure that the same storage instance is not used for multiple users.
Table of Contents
Methods
- clearAccessToken() : static
- Deletes the access token for a given $service (and current user)
- clearAllAccessTokens() : static
- Deletes all access tokens (for the current user)
- clearAllCSRFStates() : static
- Deletes all stored CSRF states (for the current user)
- clearCSRFState() : static
- Deletes a CSRF state for the given $service (and current user)
- fromStorage() : AccessToken
- Retrieves token JOSN from the underlying storage engine and returns an AccessToken
- getAccessToken() : AccessToken
- Retrieves an AccessToken for the given $service
- getCSRFState() : string
- Retrieves a CSRF <state> value for the given $service
- hasAccessToken() : bool
- Checks if a token for $service exists
- hasCSRFState() : bool
- Checks if a CSRF state for the given provider exists
- setLogger() : static
- Sets a logger. (LoggerAwareInterface is stupid)
- storeAccessToken() : static
- Stores an AccessToken for the given $service
- storeCSRFState() : static
- Stores a CSRF <state> value for the given $service
- toStorage() : mixed
- Prepares an AccessToken for storage (serialize, encrypt etc.) and returns a value that is suited for the underlying storage engine
Methods
clearAccessToken()
Deletes the access token for a given $service (and current user)
public
clearAccessToken(string $service) : static
Parameters
- $service : string
Tags
Return values
staticclearAllAccessTokens()
Deletes all access tokens (for the current user)
public
clearAllAccessTokens() : static
Tags
Return values
staticclearAllCSRFStates()
Deletes all stored CSRF states (for the current user)
public
clearAllCSRFStates() : static
Tags
Return values
staticclearCSRFState()
Deletes a CSRF state for the given $service (and current user)
public
clearCSRFState(string $service) : static
Parameters
- $service : string
Tags
Return values
staticfromStorage()
Retrieves token JOSN from the underlying storage engine and returns an AccessToken
public
fromStorage(mixed $data) : AccessToken
Parameters
- $data : mixed
Tags
Return values
AccessTokengetAccessToken()
Retrieves an AccessToken for the given $service
public
getAccessToken(string $service) : AccessToken
Parameters
- $service : string
Tags
Return values
AccessTokengetCSRFState()
Retrieves a CSRF <state> value for the given $service
public
getCSRFState(string $service) : string
Parameters
- $service : string
Tags
Return values
stringhasAccessToken()
Checks if a token for $service exists
public
hasAccessToken(string $service) : bool
Parameters
- $service : string
Return values
boolhasCSRFState()
Checks if a CSRF state for the given provider exists
public
hasCSRFState(string $service) : bool
Parameters
- $service : string
Return values
boolsetLogger()
Sets a logger. (LoggerAwareInterface is stupid)
public
setLogger(LoggerInterface $logger) : static
Parameters
- $logger : LoggerInterface
Return values
staticstoreAccessToken()
Stores an AccessToken for the given $service
public
storeAccessToken(AccessToken $token, string $service) : static
Parameters
- $token : AccessToken
- $service : string
Tags
Return values
staticstoreCSRFState()
Stores a CSRF <state> value for the given $service
public
storeCSRFState(string $state, string $service) : static
Parameters
- $state : string
- $service : string
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