douhui9192 2015-10-08 18:05
浏览 49

应用程序配置不允许给定URL:

I'm new to creating Facebook applications, but I have years of experience with php. I've created a facebook app and have the appid & secret code.

I've copied the code from https://developers.facebook.com/docs/php/howto/example_facebook_login/5.0.0 and changed the pertinent information to match my account.

However, when I go to the login.php page on my live site, I get an error "Given URL is not allowed by the Application configuration: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains."

At my develops.facebook.com page, I have set:

Display Name: P3 Live
Namespace: [blank]
App Domains: p3live.com
Contact Email: [to my email address]

Site url to 'http://www.p3live.com/facebook'.   

On Advanced:
Native or desktop app: Yes
Is App Secret embedded in the client: No

Contains Alcohol:No
Age Restriction: 13+
Social Discovery: Yes
Country Restricted: No

Server IP Whitelist: [blank]
Update Setting IP Whitelist: [blank]
Update Notification Email: [my email address]
Require App Secret: No
Require 2 Factor Reauthorization: No
Allow API Access to App Settings: Yes

Client OAuth Login: Yes
Web OAuth Login: No
Embedded Browser OAuth Login: No
Force Web OAuth Reauthentication: No

Valid OAuth redirect URIs:
http://www.p3live.com/facebook/login.php
http://www.p3live.com/facebook/fb-callback.php

Login from Devices: No

As I said, I'm new to the facebook integration and we are looking to have our app be able to post to someones wall. But first I'm just trying to get the application to login a user if they are not logged in.

I was able to get this to work with Javascript, but I want it to use the PHP SDK 5.

Any help (and advice for settings) would be greatly appreciated.

  • 写回答

1条回答 默认 最新

  • dongxi4335 2015-10-27 10:58
    关注

    You seem to pass in a wrong redirect_uri. In your settings you say that only http://www.p3live.com/facebook/login.php and http://www.p3live.com/facebook/fb-callback.php are valid, however, in your code you set the redirect_uri to http://www.p3live.com/fb-callback.php, which is not valid as per your settings.

    If you change that to http://www.p3live.com/facebook/fb-callback.php it should work.

    评论

报告相同问题?

悬赏问题

  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大