【问题标题】:Auth missing in Preview APIPreview API 中缺少身份验证
【发布时间】:2013-02-16 07:40:46
【问题描述】:

我希望能够从 Spotify 中连接到我的 Facebook 应用(Coke Highlights 允许这样做)。

但是,在 Preview API(我的应用程序需要它)中,authenticateWithFacebook 似乎丢失了:

http://developer.spotify.com/technologies/apps/docs/09321954e7.html

最接近的是:

https://developer.spotify.com/technologies/apps/docs/preview/api/api-facebook-facebooksession.html

您可以在哪里使用 showConnectUI,但这似乎不起作用并且没有记录。

【问题讨论】:

  • 嗨,我遇到了同样的问题,如果你找到任何解决方案请帮助我

标签: spotify


【解决方案1】:

auth 模块最初不存在,但现在它是 Spotify 应用 API 的一部分。您可以在its documentation page 上阅读更多相关信息。它看起来像这样:

  require(['$api/auth#Auth'], function(Auth) {
    var appId = '<your_app_id>',
        permissions = ['user_about_me'];

    var auth = new Auth();
    auth.authenticateWithFacebook(appId, permissions)
      .done(function(params) {
        if (params.accessToken) {
          console.log('Your access token: ' + params.accessToken);
        } else {
          console.log('No access token returned');
        }
      }).fail(function(req, error) {
          console.error('The Auth request failed with error: ' + error);
      });
    }
  });

另外,Tutorial App on GitHub中还有a working example

【讨论】:

    猜你喜欢
    • 2021-06-27
    • 1970-01-01
    • 2018-09-08
    • 2015-06-01
    • 2019-03-25
    • 2020-09-18
    • 1970-01-01
    • 1970-01-01
    • 2014-01-20
    相关资源
    最近更新 更多