authentication - 由 Google Script 提供支持的网络应用程序的 Authorized Javascript Origin 是什么?

标签 authentication google-apps-script oauth-2.0 credentials

我正在使用 Google Script 引擎构建一个 web 应用程序。该应用程序使用“使用 Google 登录”按钮登录,因此我需要一个在 Google Cloud Platform 中具有凭据的项目,该项目要求我在 Authorized JavaScript Origin 字段中引入一个域。 xxx.googleusercontent.com 类型的域曾经可以使用,但现在似乎已被禁止。
Google Cloud Platform Credentials
由于该应用程序由 Google Script 平台托管,因此我尝试了 URI https://script.google.com ,但它不起作用。它一直在说:
不是客户端的有效来源:https://n-lvkfgw4qjsttvut5eeun3inieub2bbse7ukpiti-0lu-script.googleusercontent.com尚未注册客户端 ID 577491057122-qlfn0853m85t0u7gsd4rr69rulghts54.apps.googleusercontent.com。请转至https://console.developers.google.com/并为您的项目的客户端 ID 注册此来源。”

错误:“idpiframe_initialization_failed”
有人知道这个问题吗?

最佳答案

回答:
关于 Google 的问题跟踪器上报告的错误对此进行了讨论 - 由于安全问题,这已被禁止。因此,目前根本没有使用 Apps Script Web App 作为 JavaScript 源的方法。
更多信息:
有问题的错误报告:

  • Fail to Add *.googleusercontent.com into Authorized JavaScript origins

  • 由于似乎没有关于这一变化的公开信息,因此进行了调查。 2021 年 3 月 31 日,一位 Google 员工最终做出了回应,解释了更改的原因,并按照预期行为关闭了问题:

    Current policies for use of OAuth 2.0 require apps to use secure JavaScript origins and redirects on domains that you own. While the use of certain shared domains is allowed (e.g. Firebase apps running on *.web.app), the use of *.googleusercontent.com as OAuth origins or redirect URIs is blocked in order to ensure the security and privacy of user accounts.

    Documentation has been updated at Redirect URI validation rules and JavaScript origin validation rules has been updated in order to reflect this:

    Host domains cannot be “googleusercontent.com”.

    关于authentication - 由 Google Script 提供支持的网络应用程序的 Authorized Javascript Origin 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67947721/

    相关文章:

    javascript - 根据单元格值将行移动到其他工作表

    facebook - FB 交换 token api 抛出错误

    authentication - 用于 Django Rest Framework API 的 token 身份验证或 OAuth 2(或两者?)

    azure - 尝试登录时找不到租户?

    Django:仅显示用户自己的数据

    php - 简单的 Twitter Oauth 授权每次都要求提供凭据

    google-apps-script - Google App Script - 允许匿名用户访问

    php - session_destroy() 根本不起作用

    windows - 在命令行验证域凭据

    javascript - 数据未按 Google 表格格式显示