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 = $inputData["grant_type"];
if (substr($uri, 0, 4) !== 'urn:') {
$uri = filter_var($uri, 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;
}