我试图通过使用来自HtmlService项目内部的gapi库进行OAuth2授权。我已经从控制台获得了我的CLIENT_ID,并且我已经设置了“授权的Javascript起源”,包含我可以想到的所有内容,例如“https://script.google.com”,“https://script.googleusercontent.com”等,但我总是以“起源不匹配”错误。Apps脚本使用来自HtmlService内部的gapi的OAuth2授权
这是我在html javascript代码中使用的代码。
function checkAuth() {
gapi.auth.authorize({
'client_id': CLIENT_ID,
'scope': SCOPES,
'immediate': false
}, handleAuthResult);
}
我在做什么错?
谢谢
你有双重检查,并遵循什么在[文件]中提及(https://developers.google.com/apps-script/guides/rest/quickstart/js#troubleshooting )? –