AbstractTokenStorage
abstract class AbstractTokenStorage implements TokenStorageInterface, TokenStorageManagementInterface
Base class for all token storage classes
Properties
protected OAuthClientInterface | $client | The Oauth client object using this storage. | |
protected array | $parameters | Parameters of this token storage. | |
protected string | $sessionId | The id of the session | |
protected string | $sessionPath | The path on the server in which the cookie will be available on. |
Methods
Constructs a token storage object derived from this class
Returns the id of the session
Returns the name of a cookie that will be used to store the session id regardless of the token storage system
Returns the session id stored in a cookie regardless of the token storage system
Returns the path on the server in which the cookie will be available on
Sets the id of the session
Sets the path on the server in which the cookie will be available on
Deletes the session cookie that holds the session id
Creates an OAuthSession object and initializes it.
Retrieves the OAuth session or create it if it does not exist
Returns the OAuth configuration for all providers where the user has logged on.
Adds the OAuth configuration of the current provider to the list of providers where the user has logged on.
Removes the OAuth configuration of the current provider from the list of providers where the user has logged on.
Retrieves an OAuth session for a given provider
Store the values of the access token when it is succefully retrieved from the OAuth provider.
Stores the user ID returned by the OAuth provider
Retrieve the OAuth access token if it was already previously stored by the storeAccessToken method.
Returns the stored state
Returns the stored nonce
Returns the stored user ID
Details
at line 60
__construct(OAuthClientInterface $client, array $parameters = [])
Constructs a token storage object derived from this class
at line 70
protected string
getSessionId()
Returns the id of the session
at line 80
protected string
getSessionCookieName()
Returns the name of a cookie that will be used to store the session id regardless of the token storage system
at line 90
protected string
getSessionCookie()
Returns the session id stored in a cookie regardless of the token storage system
at line 100
protected string
getSessionPath()
Returns the path on the server in which the cookie will be available on
at line 111
protected AbstractTokenStorage
setSessionId(string $sessionId)
Sets the id of the session
at line 123
protected AbstractTokenStorage
setSessionPath(string $sessionPath)
Sets the path on the server in which the cookie will be available on
at line 132
protected
deleteSessionCookie()
Deletes the session cookie that holds the session id
at line 142
protected OAuthSession
initializeOAuthSession()
Creates an OAuthSession object and initializes it.
at line 157
protected OAuthSession
fetchOAuthSession()
Retrieves the OAuth session or create it if it does not exist
at line 185
protected array
getProvidersInCookie()
Returns the OAuth configuration for all providers where the user has logged on.
at line 200
protected void
addProviderInCookie()
Adds the OAuth configuration of the current provider to the list of providers where the user has logged on.
at line 218
protected void
removeProviderFromCookie()
Removes the OAuth configuration of the current provider from the list of providers where the user has logged on.
at line 232
abstract bool
createOAuthSession(OAuthSession|null $session)
Creates and saves a new OAuth session
at line 237
abstract bool
getOAuthSession($session, string $provider, OAuthSession|null $oauthSession)
Retrieves an OAuth session for a given provider
at line 242
abstract bool
saveOAuthSession(OAuthSession $session)
Saves a session for later use
at line 247
bool
storeAccessToken(array $accessToken)
Store the values of the access token when it is succefully retrieved from the OAuth provider.
This method is meant to be only be called from inside the class.
Actual implementations should create a sub-class and override this function to make the access token values be stored in other types of containers, like for instance databases.
at line 258
storeUserid(string $userId)
Stores the user ID returned by the OAuth provider
at line 269
array|bool
getStoredAccessToken()
Retrieve the OAuth access token if it was already previously stored by the storeAccessToken method.
This method is meant to be only be called from inside the class.
Actual implementations should create a sub-class and override this method to retrieve the access token values from other types of containers, like for instance databases.
at line 281
string|null
getStoredState()
Returns the stored state
at line 291
string|null
getStoredNonce()
Returns the stored nonce
at line 301
string|null
getStoredUserId()
Returns the stored user ID