我正在使用link-accounts流星软件包来获取Google Contacts API的OAuth凭据。
我需要请求https://www.google.com/m8/feeds
范围以进行API调用,因此我尝试将Google帐户链接起来:
Meteor.linkWithGoogle({
scope: [
'https://www.google.com/m8/feeds'
]
}, (error) => {
...
});
但是,当我之后检查user.services.google
时,它仅显示我在Google API控制台中为此项目指定的范围,该项目是:
https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/userinfo.profile
m8/feeds
范围不是Google API控制台中的选项,因此我如何明确要求我不需要启用的范围?我认为将其作为选项传递给linkWithGoogle
呼叫会起作用,但这似乎并没有做任何事情。
感谢您的任何帮助!
将scope
更改为requestPermissions
解决了问题:
Meteor.linkWithGoogle({
requestPermissions: [
'https://www.google.com/m8/feeds'
]
}, ...