Google API无效授予不良要求
尝试连接Web应用程序时,我会在PHP中遇到此错误:
致命错误:und offeraghen \ service \ exception:{“ error”:“ invalid_grant”,“ error_description”:“ prad request”} in /var /var /wwwww /vhosts/kabengestiondeagendas.com/httpdocs/cada/vendor/google/apiclient/src/Http/REST.php:128 Stack trace: #0 /var/www/vhosts/kabengestiondeagendas.com/httpdocs/cada/vendor/google/ apiclient/src/http/rest.php(103):google \ http \ rest :: decodehttpresponse()#1 [内部函数]:google \ http \ rets :: doexecute(doexecute() 。 src/http/rest.php(66):google \ task \ task \ runner-> run()#4/var/www/www/vhosts/kabengestiondeagendas.com/httpdpdocs/cada/cada/cada/cada/cada/cada/vendor/google/google/google/google/apiclient/src/src/src/client.php/client.php/client.php/ (922):Google \ http \ rest :: execute()#5/var/www/vhosts/kabengestiondeagendas.com/httpdocs/httpdocs/cada/cada/cada/cada/vendor/google/google/apiclient/src/src/service/service/service/resource/resource.php (238) Client->execute() #6 /var/www/vhosts/kabengestiondeagendas.com/httpdocs/cada/vendor/g in /var/www/vhosts/kabengestiondeagendas.com/httpdocs/cada/vendor/google/apiclient/src /http/rest.php在第128行上的
我认为错误是在PHP中的这一代码中:
if ($client->isAccessTokenExpired())
{
// the new access token comes with a refresh token as well
$client->fetchAccessTokenWithRefreshToken($client->getRefreshToken());
file_put_contents($TOKEN_FILE, json_encode($client->getAccessToken()));
}
有人可以帮助我吗?谢谢!!
I get this error in PHP when trying to connect a WEB application:
Fatal error: Uncaught Google\Service\Exception: { "error": "invalid_grant", "error_description": "Bad Request" } in /var/www/vhosts/kabengestiondeagendas.com/httpdocs/cada/vendor/google/apiclient/src/Http/REST.php:128 Stack trace: #0 /var/www/vhosts/kabengestiondeagendas.com/httpdocs/cada/vendor/google/apiclient/src/Http/REST.php(103): Google\Http\REST::decodeHttpResponse() #1 [internal function]: Google\Http\REST::doExecute() #2 /var/www/vhosts/kabengestiondeagendas.com/httpdocs/cada/vendor/google/apiclient/src/Task/Runner.php(182): call_user_func_array() #3 /var/www/vhosts/kabengestiondeagendas.com/httpdocs/cada/vendor/google/apiclient/src/Http/REST.php(66): Google\Task\Runner->run() #4 /var/www/vhosts/kabengestiondeagendas.com/httpdocs/cada/vendor/google/apiclient/src/Client.php(922): Google\Http\REST::execute() #5 /var/www/vhosts/kabengestiondeagendas.com/httpdocs/cada/vendor/google/apiclient/src/Service/Resource.php(238): Google\Client->execute() #6 /var/www/vhosts/kabengestiondeagendas.com/httpdocs/cada/vendor/g in /var/www/vhosts/kabengestiondeagendas.com/httpdocs/cada/vendor/google/apiclient/src/Http/REST.php on line 128
I think the error is in this piece of code in PHP:
if ($client->isAccessTokenExpired())
{
// the new access token comes with a refresh token as well
$client->fetchAccessTokenWithRefreshToken($client->getRefreshToken());
file_put_contents($TOKEN_FILE, json_encode($client->getAccessToken()));
}
Can somebody help me? Thanks!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我设法使用以下代码撤销了Accestoken:
I managed to revoke the accestoken with the following code: