Facebook PHP SDK-登录助手返回错误 [英] Facebook PHP SDK - Login helper returns error

查看:88
本文介绍了Facebook PHP SDK-登录助手返回错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个应用程序,女巫正在使用Facebook作为登录机会.我的APP在1天前就可以正常运行了,但今天,当我的用户登录时,它开始出现此错误:

i have created a app witch are using facebook as a login opportunity. My APP worked public fine 1 day ago, but today it started getting this error when my users are logging in:

图形返回错误:无法加载URL:此URL的域未包含在应用程序的域中.为了能够加载此URL,请将应用程序的所有域和子域添加到应用程序设置的应用程序域"字段中.

Graph returned an error: Can't Load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and subdomains of your app to the App Domains field in your app settings.

我的代码如下:

<?php
require 'vendor/autoload.php';

if(!session_id()) {
    session_start();
}

// Setting a local setting
$fb = new Facebook\Facebook([
  'app_id' => '****',
  'app_secret' => '****',
  'default_graph_version' => 'v2.2',
  ]);

// Setting up the Facebook Helper
$helper = $fb->getRedirectLoginHelper();

//Genneration FaceBook Callback Script
$loginUrl = $helper->getLoginUrl('https://gymbilletter.dk/facebook/facebook_callback.php',array('scope' => 'email'));
header("Location: ".$loginUrl);

并且我已将我的退货域列入白名单: Facebook OAuth重新链接

And i have whitelisted my return domain: Facebook OAuth Rederictlinks

我试图在实习生中寻找答案,但是我得到的唯一答案是将5.6.1更新为5.6.2,但是我已经在使用5.6.3

I have tried to search the interned for answers, but the only answers i get is to update from 5.6.1 to 5.6.2 but i am already using 5.6.3

推荐答案

我在这里也遇到了同样的问题

Hi i faced same issue over here

https://stackoverflow.com/a/52096688/1234825

并尝试了另一种方法

Facebook似乎违反"了自己的代码.通过启用 在https之前,验证OAuth" URL不再验证.

Facebook seems to have "short of" break its own code. By enabling enfore https, the Validate OAuth url no longer validates.

我在重定向网址上添加了以下参数,以绕过 问题

I have added the following param on my redirect url to bypass the issue

https://mysubdomain.mysite.gr/index.php?r=site/callbackfb&enforce_https=1

这篇关于Facebook PHP SDK-登录助手返回错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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