mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-15 09:47:46 +05:30
Implemented validateAccessToken in PDO
This commit is contained in:
parent
2866185349
commit
92303c7b26
@ -202,12 +202,20 @@ class Session implements SessionInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate an access token
|
* Validate an access token
|
||||||
* @param string $accessToken [description]
|
* @param string $accessToken The access token to be validated
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function validateAccessToken($accessToken)
|
public function validateAccessToken($accessToken)
|
||||||
{
|
{
|
||||||
throw new \Exception('Not implemented - ' . debug_backtrace()[0]['function']);
|
$db = \ezcDbInstance::get();
|
||||||
|
|
||||||
|
$stmt = $db->prepare('SELECT session_access_token_id FROM `oauth_session_access_tokens` WHERE
|
||||||
|
access_token = :accessToken AND access_token_expires <= ' . time());
|
||||||
|
$stmt->bindValue(':accessToken', $accessToken);
|
||||||
|
$stmt->execute();
|
||||||
|
|
||||||
|
$result = $stmt->fetchObject();
|
||||||
|
return ($result === false) ? false : $result->session_access_token_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user