Documentation

OAuthStorageInterface

Specifies the methods required for an OAuth storage adapter

The storage is intended to be invoked per-user, for whom it can store tokens, state etc. 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 $provider (and current user)
clearAllAccessTokens()  : static
Deletes all access tokens (for the current user)
clearAllCodeVerifiers()  : static
Deletes all PKCE verifiers for this user
clearAllCSRFStates()  : static
Deletes all stored CSRF states (for the current user)
clearCodeVerifier()  : static
Deletes a PKCE verifier
clearCSRFState()  : static
Deletes a CSRF state for the given $provider (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 $provider
getCodeVerifier()  : string
Retrieves a PKCE verifier
getCSRFState()  : string
Retrieves a CSRF <state> value for the given $provider
hasAccessToken()  : bool
Checks if a token for $provider exists
hasCodeVerifier()  : bool
Checks whether a PKCE verifier 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 $provider
storeCodeVerifier()  : static
Stores a PKCE verifier
storeCSRFState()  : static
Stores a CSRF <state> value for the given $provider
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 $provider (and current user)

public clearAccessToken(string $provider) : static
Parameters
$provider : string
Tags
throws
OAuthStorageException
Return values
static

clearAllCodeVerifiers()

Deletes all PKCE verifiers for this user

public clearAllCodeVerifiers() : static
Return values
static

clearCodeVerifier()

Deletes a PKCE verifier

public clearCodeVerifier(string $provider) : static
Parameters
$provider : string
Return values
static

clearCSRFState()

Deletes a CSRF state for the given $provider (and current user)

public clearCSRFState(string $provider) : static
Parameters
$provider : string
Tags
throws
OAuthStorageException
Return values
static

getCodeVerifier()

Retrieves a PKCE verifier

public getCodeVerifier(string $provider) : string

This method must throw a ItemNotFoundException if a verifier is not found

Parameters
$provider : string
Tags
throws
ItemNotFoundException
Return values
string

getCSRFState()

Retrieves a CSRF <state> value for the given $provider

public getCSRFState(string $provider) : string

This method must throw a ItemNotFoundException if a state is not found

Parameters
$provider : string
Tags
throws
ItemNotFoundException
Return values
string

hasAccessToken()

Checks if a token for $provider exists

public hasAccessToken(string $provider) : bool
Parameters
$provider : string
Return values
bool

hasCodeVerifier()

Checks whether a PKCE verifier exists

public hasCodeVerifier(string $provider) : bool
Parameters
$provider : string
Return values
bool

hasCSRFState()

Checks if a CSRF state for the given provider exists

public hasCSRFState(string $provider) : bool
Parameters
$provider : string
Return values
bool

setLogger()

Sets a logger. (LoggerAwareInterface is stupid)

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

storeCodeVerifier()

Stores a PKCE verifier

public storeCodeVerifier(string $verifier, string $provider) : static
Parameters
$verifier : string
$provider : string
Return values
static

storeCSRFState()

Stores a CSRF <state> value for the given $provider

public storeCSRFState(string $state, string $provider) : static
Parameters
$state : string
$provider : string
Tags
throws
OAuthStorageException
Return values
static

        
On this page

Search results