JWT 用于 Google Apps 脚本?

问题描述 投票:0回答:2

我使用的 API 需要使用几个特定且唯一的参数生成的 JSON Web 令牌。在 Node 中,只需使用

var jwt = require(jsonwebtoken')
即可加载正确的库,但这无法在 Apps 脚本中完成。

有没有一个GAS库可以替代node的jsonwebtoken模块?

google-apps-script javascript
2个回答
0
投票

您可以使用脚本Class.getIdentityToken(); https://developers.google.com/apps-script/reference/script/script-app#getIdentityToken()

在您的应用程序脚本清单中,您必须添加范围 https://www.googleapis.com/auth/userinfo.emailhttps://www.googleapis.com/auth/userinfo.profile

链接中有更多详细信息


-1
投票

在 Google Apps 脚本服务器端代码只能“需要”来自其他 Google Apps 脚本项目的代码。有关详细信息,请参阅

相关问答

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.