为 facebook OAuth2 指定多个重定向 URI [英] Specify multiple redirect URIs for facebook OAuth2

查看:32
本文介绍了为 facebook OAuth2 指定多个重定向 URI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 Web 应用程序已部署到生产站点,但我还需要执行本地开发.此外,我有几个测试服务器,我在其中执行不同的测试活动.我想为 Facebook OAuth2 指定所有这些 URI.使用 Google OAuth2 没有问题:我可以根据需要指定任意数量的重定向 URI.

My web application is deployed to a production site, but I also need to perform local development. Besides, I have a couple of test servers where I perform different testing activities. I would like to specify all these URIs for Facebook OAuth2. With Google OAuth2 there is no problem: I can specify as many redirect URIs as I need.

这可以通过 Facebook 实现吗?如何?我正在使用使用 Facebook 登录的网站"选项与 Facebook 集成.

Is this possible with Facebook? How? I am using the "Website with Facebook Login" option to integrate with Facebook.

目前我得到:

{
    error: {
        message: "Invalid redirect_uri: Given URL is not allowed by the Application configuration.",
        type: "OAuthException",
        code: 191
    }
}

推荐答案

您将不得不根据您的要求为不同的用例创建不同的应用程序.这是您必须处理的一个奇怪的限制.

You will have to instead create different application for different Use Cases as per your requirement. This is one strange limitation that you will have to deal with.

虽然无关,但 Heroku(它是合作伙伴云服务提供商)的 Getting Started Guide for Facebook 建议对于在本地工作应用程序和开发进行相同的工作.

Although unrelated but Heroku's (which is partner Cloud service provider) Getting Started Guide for Facebook suggests the same work through for working locally with the application along with development.

这篇关于为 facebook OAuth2 指定多个重定向 URI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆