为什么几天后我的Google Apps脚本权限被吊销? [英] Why my Google Apps Script permissions are revoked after few days?

本文介绍了为什么几天后我的Google Apps脚本权限被吊销?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个简单的Telegram机器人,该机器人在Google Apps脚本的帮助下可以在Google Spreadsheet上运行.它会在工作表中进行查找,并且可以选择将上传的文件保存到我的Google云端硬盘中.

I made a simple Telegram bot that runs on Google Spreadsheet with a help of Google Apps Script. It does a lookup in sheets and optionally saves an uploaded file to my Google Drive.

以前,它是附加到电子表格的脚本.后来Google建议在Google Cloud Console中创建一个应用程序,并将脚本分配给该应用程序ID,以便所有API调用均应负责.

Previously it was a Script attached to the Spreadsheet. Later Google suggested to create an App in Google Cloud Console and assign the script to that App id, so all API calls are accountable.

脚本应用未经过验证,并在发布状态:测试"中运行模式.我只需要它即可访问我的帐户数据.

Script app is not verified and runs in "Publishing status: Test" mode. I only need it to access my account's data.

我授予脚本的权限(访问表格,云端硬盘)的权限在大约2-3天后会自动撤消,而不会发出任何通知,并且该漫游器会停止工作.在我重新访问Shpreadsheet之前,打开Extensions-Apps Script,运行任何功能,然后再次要求授权.然后,该机器人可以再工作几天.

The permissions I gave to the script (access to Sheets, Drive) get automatically revoked without any notice after about 2-3 days, and the bot stops working. Until I revisit the Shpreadsheet, open Extensions - Apps Script, run any function and it asks for authorization again. Then the bot works for a couple of days more.

如何使授予的权限永久化?

How can I make the permissions I give permanent?

我(再次)授予我的应用程序权限:

Permissions I granted (again) to my app:

电子表格应用程序的更新菜单:

Updated menu of the Spreadsheet app:

推荐答案

来自设置OAuth同意屏幕>测试

测试用户的授权将自同意之日起7天到期.如果您的OAuth客户端请求离线访问类型并收到刷新令牌,则该令牌也将过期.

Authorizations by a test user will expire seven days from the time of consent. If your OAuth client requests an offline access type and receives a refresh token, that token will also expire.

考虑到上述情况,您必须让您的应用得到Google的验证.

Considering the above you have to get your app to be verified by Google.

这篇关于为什么几天后我的Google Apps脚本权限被吊销?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆