Google 脚本 Oauth v1.0 REST API 访问

Google Script Oauth v1.0 REST API access

我需要一种方法来访问 google 脚本中的 Oauth v1.0 rest API 表单。 google apps script.

我找到了 this page 上面说图书馆是2015年的日落。我试着加上去。当我这样做时,我得到一个错误,它不再被支持,我的脚本拒绝 运行.

错误:

Exception: ScriptError Exception: Script is using OAuthConfig which has been shut down. Learn more at https://cloud.google.com/blog/changes-oauth-apps-script [ { function: 'test', lineNumber: 80 } ]

我需要访问外部站点来下载一些数据。我正在尝试访问 Gravity Forms.

中的数据

他们正在使用 Oauth v1.0。

我可以使用 Postman / Oauth v1.0 正常访问数据。但是我找不到 google 应用程序脚本的解决方案。

任何人都可以指出让 Oauth v1.0 正常工作的正确方向吗?可能是一个完整的 JS 选项?

documentation says

The URL Fetch service's OAuthConfig class provided a simple mechanism for connecting to an API that utilized OAuth, specifically OAuth versions 1.0 and 1.0a. This mechanism was sunset on July 6, 2015. The open source library OAuth1 for Apps Script was created as a replacement, and this page will demonstrate how to update your scripts to use this new mechanism.

  • 日落的机制是UrlFetchAppaddOauthService方法(Class OAuthConfig).

  • 提供的替换是开源库here

  • 官方推荐此库,定期更新

Warning: Google's OAuth 1.0 support was deprecated in 2012 and is scheduled to be shut down on April 20, 2015. Scripts using OAuthConfig to connect to a Google API should instead use the OAuth2 for Apps Script library.

  • 这个关闭指的是Google自己的oauth 1.0对Googleapi的支持,比如Google映射api或者Google 驱动器 api 并且不指代所有第三方 apis