Specify multiple redirect URIs for facebook OAuth2

别说谁变了你拦得住时间么 提交于 2019-12-29 05:23:08

问题


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.

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

Currently I am getting:

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

回答1:


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.

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.




回答2:


I'm not sure when they added this, but I just discovered a "Valid OAuth redirect URIs" field in the "Advanced" settings of my Facebook app. I just put http://localhost in there and it appears to allow redirect to any URI on my localhost. No more duplicate apps!



来源:https://stackoverflow.com/questions/16415060/specify-multiple-redirect-uris-for-facebook-oauth2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!