protected function grantAccessTokenExtension(IOAuth2Client $client, array $inputData, array $authHeaders) { if (!$this->storage instanceof IOAuth2GrantExtension) { throw new OAuth2ServerException(self::HTTP_BAD_REQUEST, self::ERROR_UNSUPPORTED_GRANT_TYPE); } $uri = filter_var($inputData["grant_type"], FILTER_VALIDATE_URL); $stored = $this->storage->checkGrantExtension($client, $uri, $inputData, $authHeaders); if ($stored === false) { throw new OAuth2ServerException(self::HTTP_BAD_REQUEST, self::ERROR_INVALID_GRANT); } return $stored; }