1

Today, I've been trying to setup facebook app for localhost and I couldn't find the right solution for it. It was working in the past and I don't know what facebook updated with it...

Here's what I did:

  1. I've created test app from one of my public app

  2. In settings, I set site domain as "localhost" and site url as "http://localhost:8888/"

  3. In settings/advanced, I set Valid OAuth redirect URIs as "http://localhost:8888/" again.

And when I try to login, I got the error message like below:

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

Also I have public ip for my localhost and I tried to set it instead of localhost like "http://xx.xxx.xxx.xx:8888/" but it's still not working.

I'm really embarrased because it was working before. Can someone please help me out with this ?

Thanks in advance.

4

1 回答 1

0

以下是让我的本地应用程序与 Facebook 一起工作的步骤:

第一部分:

  • 转到developers.facebook.com
  • 将鼠标悬停在右侧的“我的应用程序”下拉菜单上,然后单击“添加应用程序”或单击 [创建应用程序](如果这是您看到的唯一选项)。
  • 点击左上角的“设置”
  • 将“App Id”和“Secret Id”复制到 .env 文件中的 FACEBOOK_APP_ID 和 FACEBOOK_SECRET_ID
  • 输入app域(如:localhost或yourappname.app等)
  • 单击屏幕底部的 [+ 添加平台] 按钮,然后选择“网站”。输入http://localhost:8000
  • 单击[保存更改]

第二部分:

  • 点击左下角的【+添加产品】
  • 选择 Facebook 登录
  • 点击“Facebook登录”下方的“设置”
  • 在有效 OAuth 重定向 URI 下输入您的回调 URL(例如:http://localhost:8000/login/facebook/callback
  • 为所需的允许设备类型打开 OAuth 登录
  • 单击[保存更改]

第三部分:

  • 点击屏幕左上角附近的“App Review”
  • 切换“公开[您的应用名称]?” 滑块到“是”
于 2017-09-13T20:32:59.633 回答