使用服务帐户和谷歌云端硬盘API invalid_grant返回 [英] invalid_grant Returned using Service Account and Google Drive API
问题描述
我已经花了2天使用一次服务帐户与各种驱动API教程乱搞。
I've spent 2 days messing around with various Drive API tutorials using a Service Account.
我最近使用的教程是这样: https://developers.google.com/drive/代表团
The most recent tutorial i used was this one: https://developers.google.com/drive/delegation
我不断收到试图上传一个文件时,这个错误:
I keep getting this error when trying to upload a file:
ProtocolException was unhandled
Error occurred while sending a direct message or getting the response.
我安装提琴手并确定当 POST / O /的oauth2 /令牌
返航:
{
"error:"invalid_grant"
}
我已经三+检查了我的应用范围。
I have already triple+ checked the scope of my application.
我在做什么错了?
推荐答案
原来在我的服务器是时间5分钟快。
Turns out the time on my server was 5 min fast.
当我纠正了时间上的服务器一切正常。
When I corrected the time on the server everything worked.
我相信这是造成某种身份验证问题,因为谷歌服务器的时间没有接受请求的时间戳从我的服务器或类似的规定来了...
I believe this was causing some kind of authentication issue because the Google Server time didn't accept the timestamp of the request coming from my server or something along those lines...
(希望这可以节省一些人撞头)
(Hope this saves someone some head banging)
这篇关于使用服务帐户和谷歌云端硬盘API invalid_grant返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!