diff --git a/src/League/OAuth2/Server/Resource.php b/src/League/OAuth2/Server/Resource.php index 8c7af57c..5160bf70 100644 --- a/src/League/OAuth2/Server/Resource.php +++ b/src/League/OAuth2/Server/Resource.php @@ -133,10 +133,10 @@ class Resource extends AbstractServer * @param $headersOnly Limit Access Token to Authorization header only * @return bool */ - public function isValid($headersOnly = false) + public function isValid($headersOnly = true, $accessToken = null) { try { - $accessTokenString = $this->determineAccessToken($headersOnly); + $accessTokenString = ($accessToken !== null) ? $accessToken : $this->determineAccessToken($headersOnly, $accessToken); } catch (\Exception $e) { return false; }