【问题标题】:Specify scope for Meteor link-accounts package?指定 Meteor 链接帐户包的范围?
【发布时间】:2016-06-24 04:46:48
【问题描述】:

我正在使用link-accountsmeteor 包获取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.emailhttps://www.googleapis.com/auth/userinfo.profile

m8/feeds 范围不是 Google API 控制台中启用的选项,所以 我如何在不启用的情况下明确请求我需要的范围?我想将它作为一个选项传递给linkWithGoogle 调用会起作用,但这似乎没有任何作用。

感谢您的帮助!

【问题讨论】:

    标签: javascript google-api meteor-accounts


    【解决方案1】:

    scope 更改为requestPermissions 解决了这个问题:

    Meteor.linkWithGoogle({
      requestPermissions: [
        'https://www.google.com/m8/feeds'
      ]
    }, ...
    

    【讨论】:

      猜你喜欢
      • 2014-03-09
      • 2012-04-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-15
      • 2020-10-27
      相关资源
      最近更新 更多