diff options
author | Frédéric Guillot <fguillot@users.noreply.github.com> | 2014-05-03 22:24:03 -0400 |
---|---|---|
committer | Frédéric Guillot <fguillot@users.noreply.github.com> | 2014-05-03 22:24:03 -0400 |
commit | 560a12f0bd6347a335f8ed5201d6d9562d03d4bc (patch) | |
tree | 00510d25c1cf5e747573543fa88d44ef003b1c9a /vendor/OAuth/Common/Storage/TokenStorageInterface.php | |
parent | 9531e439cd99fb7dbcfb039f422f1d1ba414ec30 (diff) |
Add Google authentication
Diffstat (limited to 'vendor/OAuth/Common/Storage/TokenStorageInterface.php')
-rwxr-xr-x | vendor/OAuth/Common/Storage/TokenStorageInterface.php | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/vendor/OAuth/Common/Storage/TokenStorageInterface.php b/vendor/OAuth/Common/Storage/TokenStorageInterface.php new file mode 100755 index 00000000..46552cee --- /dev/null +++ b/vendor/OAuth/Common/Storage/TokenStorageInterface.php @@ -0,0 +1,98 @@ +<?php + +namespace OAuth\Common\Storage; + +use OAuth\Common\Token\TokenInterface; +use OAuth\Common\Storage\Exception\TokenNotFoundException; + +/** + * All token storage providers must implement this interface. + */ +interface TokenStorageInterface +{ + /** + * @param string $service + * + * @return TokenInterface + * + * @throws TokenNotFoundException + */ + public function retrieveAccessToken($service); + + /** + * @param string $service + * @param TokenInterface $token + * + * @return TokenStorageInterface + */ + public function storeAccessToken($service, TokenInterface $token); + + /** + * @param string $service + * + * @return bool + */ + public function hasAccessToken($service); + + /** + * Delete the users token. Aka, log out. + * + * @param string $service + * + * @return TokenStorageInterface + */ + public function clearToken($service); + + /** + * Delete *ALL* user tokens. Use with care. Most of the time you will likely + * want to use clearToken() instead. + * + * @return TokenStorageInterface + */ + public function clearAllTokens(); + + /** + * Store the authorization state related to a given service + * + * @param string $service + * @param string $state + * + * @return TokenStorageInterface + */ + public function storeAuthorizationState($service, $state); + + /** + * Check if an authorization state for a given service exists + * + * @param string $service + * + * @return bool + */ + public function hasAuthorizationState($service); + + /** + * Retrieve the authorization state for a given service + * + * @param string $service + * + * @return string + */ + public function retrieveAuthorizationState($service); + + /** + * Clear the authorization state of a given service + * + * @param string $service + * + * @return TokenStorageInterface + */ + public function clearAuthorizationState($service); + + /** + * Delete *ALL* user authorization states. Use with care. Most of the time you will likely + * want to use clearAuthorization() instead. + * + * @return TokenStorageInterface + */ + public function clearAllAuthorizationStates(); +} |