【问题标题】:redirect_uri is not supported: facebook authentication for ionic and satellizer不支持 redirect_uri: ionic 和 satellizer 的 facebook 身份验证
【发布时间】:2015-12-15 17:31:25
【问题描述】:

我在我的 ionic 应用程序中使用 satellizer 库进行 facebook 身份验证。

在开发过程中(在浏览器中完成).. satellizer fb 对象配置为:

$authProvider.facebook({
  clientId: AppConstants.facebook.clientId,
  scope: 'user_friends',
  url: 'http://localhost:3000/auth/facebook'
});

这很好用。但是,当我在模拟器中运行应用程序的那一刻,我收到以下错误:

The redirect_uri is not supported

如何解决这个问题?

【问题讨论】:

    标签: angularjs ionic satellizer


    【解决方案1】:

    问题在于,当您使用模拟器(或手机)时,默认的 redirectUri 变为 file:///,这是 Facebook 不允许的。将其更改为 http://localhost/ 之类的东西,并将其添加到 Facebook 开发控制台中允许的重定向 uri。

    默认配置: redirectUri: window.location.origin + '/'

    更改为: redirectUri: 'http://localhost/'

    所以您的设置将如下所示:

    $authProvider.facebook({
      clientId: AppConstants.facebook.clientId,
      scope: 'user_friends',
      url: 'http://localhost:3000/auth/facebook', 
      redirectUri: 'http://localhost/'
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-02-24
      • 2015-08-10
      • 2016-10-10
      • 1970-01-01
      • 2016-03-29
      • 1970-01-01
      • 2013-12-24
      相关资源
      最近更新 更多