简体   繁体   English

Google Sheets 脚本需要授权,oauth 客户端说它被删除了,但它都在我们的域内

[英]Google Sheets script requires authorization, oauth client says it was deleted, but it's all inside our domain

In 2014, a user in our company created a series of spreadsheets to track money, and he's now retired. 2014 年,我们公司的一位用户创建了一系列电子表格来跟踪资金,现在他已经退休了。 Everything worked until recently.直到最近一切都有效。 (Also, we are gsuite customers, which is relevant since the sheets are shared within the company.) (此外,我们是 gsuite 客户,这是相关的,因为这些表是在公司内部共享的。)

I am trying to run a script attached to the "Summary" spreadsheet to move everything to the "History" spreadsheet, and then reset the "Summary" to this month.我正在尝试运行附加到“摘要”电子表格的脚本以将所有内容移动到“历史”电子表格,然后将“摘要”重置为本月。 This code has worked since 2014, including when the regular user switched from July 2020 to August 2020. Now, when I run the script from the sheet, it says "Authorization required: A script attached to this document needs your permission to run."此代码自 2014 年以来一直有效,包括普通用户从 2020 年 7 月切换到 2020 年 8 月。现在,当我从工作表运行脚本时,它显示“需要授权:附加到此文档的脚本需要您的许可才能运行。” Based on this google documentation , there's nothing I can do to make it not ask permission.根据这个 google 文档,我无法让它不征得许可。

Once I hit continue, it says "Authorization Error. Error 401: deleted_client The OAuth Client was deleted."一旦我点击继续,它会显示“授权错误。错误 401:deleted_client OAuth 客户端已删除。”

This spreadsheet hasn't been shared outside our domain, and shouldn't be used outside our domain.此电子表格尚未在我们的域外共享,不应在我们的域外使用。 Google says here that "Verification is not required for Apps Script projects whose owner and users belong to the same G Suite domain or customer." 谷歌在这里表示,“所有者和用户属于同一 G Suite 域或客户的 Apps 脚本项目不需要验证。” which is exactly what we have.这正是我们所拥有的。

So why does it require authorization?那么为什么需要授权呢?

As far as I know, nothing has been deleted.据我所知,没有任何内容被删除。 The retired user's account is still open.退休用户的帐户仍处于打开状态。

I have also tried going into console.developers.google.com and created a project with oauth credentials, but that doesn't seem like what is needed.我还尝试进入 console.developers.google.com 并使用 oauth 凭据创建了一个项目,但这似乎不是必需的。

I can update with code if you feel it's necessary, but it doesn't seem like a code problem.如果您觉得有必要,我可以使用代码进行更新,但这似乎不是代码问题。

Edit: Working on a minimal reproducible example, but it's taking a while.编辑:正在研究一个最小的可重复示例,但需要一段时间。 I tried to just have the Summary and History spreadsheets, but part of annonymizing the data involved removing links from the 6 department spreadsheets.我试图只拥有摘要和历史电子表格,但匿名数据的一部分涉及从 6 个部门电子表格中删除链接。 Removing those "fixed" the problem.删除那些“固定”的问题。 Instead of saying "The OAuth Client was deleted."而不是说“OAuth 客户端已删除”。 it acted as normal.它表现得很正常。 (It showed my logged in account, I clicked it, etc, it worked.) (它显示了我登录的帐户,我点击了它,等等,它起作用了。)

The issue seems to be related to importing data from 6 spreadsheets into one, and then moving all that data.该问题似乎与将 6 个电子表格中的数据导入到一个电子表格中,然后移动所有这些数据有关。 I'm working on that.我正在努力。

Using what Alan Wells said about the "Cloud Platform Project," I found this StackOverflow post and followed it.根据 Alan Wells 关于“云平台项目”的说法,我找到了这篇 StackOverflow 帖子并关注了它。 I made a copy of the script and deleted the old one.我复制了脚本并删除了旧脚本。 I refreshed the spreadsheet, and now the authentication works!我刷新了电子表格,现在身份验证有效了!

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

相关问题 Google Apps 脚本:“错误 401:deleted_client OAuth 客户端已被删除”突然? - Google Apps Script: "Error 401: deleted_client The OAuth client was deleted" All of a sudden? 在我的G Suite域中的Google表格中记录工作表用户名时禁用脚本授权 - Disable Script authorization when logging sheet username in Google Sheets within my G suite domain Google表格说“完成脚本”,但什么也没发生 - Google sheets says “Finished script” but nothing happened 调用需要AJAX授权的Google Apps脚本 - Call a Google Apps Script that requires authorization in AJAX Google Apps脚本oAuth onOpen授权 - Google Apps Script oAuth onOpen authorization 在四张纸上隐藏除今天以外的所有列(Google Spreadsheets脚本) - Hide all but today's columns on four sheets (Google Spreadsheets script) Google 表格在所有表格中运行脚本 - Google Sheets run the script in all sheets 该域是否可用或已被占用? 在 Google 表格应用程序脚本中 - Is this domain available or taken? In Google Sheets apps script Oauth2 服务创建 hasAccess() 在 Google 表格脚本中为除所有者之外的所有用户失败 - Oauth2 service creation hasAccess() fails in Google Sheets script for all users except owner 通过Google Apps脚本获取域的所有电子邮件地址 - Get all of domain's email addresses by a Google Apps Script
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM