简体   繁体   English

在后台将文件上传到Google云端硬盘

[英]Uploading files to Google Drive in the background

When authenticating a user on the website I get an access token 在网站上对用户进行身份验证时,我会获得访问令牌

{
"access_token": "ya29.igD5RcTYjTQgJwGL_LFB7HFeWOZvGWTTO8JWpqGNaMOuMssswynugEea",
"token_type": "Bearer",
"expires_in": 3600,
"created": 1411545943
}

My problem is this will expire in one hour and I need to upload files in background using a cron job, this could be a week later. 我的问题是,这将在一个小时后到期,我需要使用cron作业在后台上传文件,这可能是一周之后。 Is there a method to either get a token that will never expire or perhaps something I haven't considered? 是否有一种方法可以获取永不过期的令牌,或者可能是我从未考虑过的方法?

You can get refresh tokens, check the docs at 您可以获取刷新令牌,请在以下位置查看文档

https://developers.google.com/accounts/docs/OAuth2 . https://developers.google.com/accounts/docs/OAuth2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM