From 6d8eb9d05e673a12c91e51e28e7c0f6a01bad958 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Thu, 9 May 2013 11:40:29 -0700 Subject: [PATCH] Added removeRefreshToken method to SessionInterface --- src/League/OAuth2/Server/Storage/PDO/Session.php | 9 +++++++++ .../OAuth2/Server/Storage/SessionInterface.php | 14 ++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/League/OAuth2/Server/Storage/PDO/Session.php b/src/League/OAuth2/Server/Storage/PDO/Session.php index 3f16b074..311ce3f1 100644 --- a/src/League/OAuth2/Server/Storage/PDO/Session.php +++ b/src/League/OAuth2/Server/Storage/PDO/Session.php @@ -125,6 +125,15 @@ class Session implements SessionInterface return ($result === false) ? false : (array) $result; } + public function removeRefreshToken($refreshToken) + { + $db = \ezcDbInstance::get(); + + $stmt = $db->prepare('DELETE FROM `oauth_session_refresh_tokens` WHERE refresh_token = :refreshToken'); + $stmt->bindValue(':refreshToken', $refreshToken); + $stmt->execute(); + } + public function validateRefreshToken($refreshToken, $clientId) { $db = \ezcDbInstance::get(); diff --git a/src/League/OAuth2/Server/Storage/SessionInterface.php b/src/League/OAuth2/Server/Storage/SessionInterface.php index 0ac09953..30b0a6e1 100644 --- a/src/League/OAuth2/Server/Storage/SessionInterface.php +++ b/src/League/OAuth2/Server/Storage/SessionInterface.php @@ -185,6 +185,20 @@ interface SessionInterface */ public function validateAccessToken($accessToken); + /** + * Removes a refresh token + * + * Example SQL query: + * + * + * DELETE FROM `oauth_session_refresh_tokens` WHERE refresh_token = :refreshToken + * + * + * @param string $refreshToken The refresh token to be removed + * @return void + */ + public function removeRefreshToken($refreshToken); + /** * Validate a refresh token *