新谷歌聊天聊天的文档说你需要授权范围https://www.googleapis.com/auth/chat.bot做几乎任何事情.
这是错误:
在使用OAuth2客户端生成身份验证URL时,我收到范围无效的消息.如果我使用https://www.googleapis.com/auth/chat或google plus等其他范围,我就没有这个问题.
当我尝试在API资源管理器中搜索内容时,URL或URL部分的组合也不起作用.
这是我获取URL的代码,似乎对其他一切工作正常:
var {google} = require('googleapis');
var OAuth2 = google.auth.OAuth2;
var oauth2Client = new OAuth2(
"clientid-idididid.apps.googleusercontent.com",
"_secretsuff",
"http://localhost:3000/auth/google/callback"
);
var scopes = [
"https://www.googleapis.com/auth/chat", //Works
"https://www.googleapis.com/auth/chat.bot" // Does not work
];
var url = oauth2Client.generateAuthUrl({
access_type: 'offline',
scope: scopes,
});
console.log(url);Run Code Online (Sandbox Code Playgroud)