简体   繁体   English

图表返回错误:无法加载网址:此网址的域未包含在应用的域中

[英]Graph returned an error: Can't Load URL: The domain of this URL isn't included in the app's domains

Added domain in App Domains, Valid OAuth redirect URIs also added.. but, Getting error message like this I have done my best... Anybody help me... it was quite irritating, I'm loosing my patience and getting panic. 在App Domains中添加了域,还添加了有效的OAuth重定向URI ..但是,收到这样的错误消息我已经尽了最大努力......任何人都帮助我...这令人非常恼火,我正在失去耐心并感到恐慌。 I really don't know, what is my big mistake in this. 我真的不知道,这是我最大的错误。 See this following images to know more about my problem 请参阅以下图片以了解有关我的问题的更多信息

图片1

图2

We have 3 ways to fix it 我们有3种方法可以解决它

1) Turn Off 1)关闭

Use Strict Mode for Redirect URIs 使用严格模式重定向URI

in Facebook Login-> Settings 在Facebook登录 - >设置

2) 2)

$accessToken = $helper->getAccessToken();

to

$accessToken = $helper->getAccessToken('https://example.com/your-CallBack-URI-page.php');

3) This is fine for development purpose when you don't want to waste time, for production use 3)当您不想浪费时间用于生产时,这对于开发目的是好的

session_start();
require_once __DIR__ . '/vendor/autoload.php';

$fb = new Facebook\Facebook([
  'app_id' => 'appid',
  'app_secret' => 'app secret',
  'default_graph_version' => 'v2.6 ', 
  "persistent_data_handler"=>"session"
  ]);
$helper = $fb->getRedirectLoginHelper();
$permissions = ['email']; // optional

$loginUrl = $helper->getLoginUrl('domain.com/php-graph-sdk-5.x/login-callback.php/', $permissions);
$_SESSION['FBRLH_state']=$_GET['state'];
try {
  $accessToken = $helper->getAccessToken('domian.com/php-graph-sdk-5.x/login-callback.php/');
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  // When Graph returns an error
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  // When validation fails or other local issues
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}

From march the strict mode will be forced as enable. 从3月开始,严格模式将被强制启用。 If you have any query parameters to your redirect url they should be included in the state parameter. 如果您的重定向网址有任何查询参数,则它们应包含在state参数中。

For details check my answer to a similar post. 有关详细信息,请查看我对类似帖子的回答

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Facebook 显示错误:无法加载 URL:此 URL 的域未包含在应用程序的域中 - Facebook showing error: Can't Load URL: The domain of this URL isn't included in the app's domains Facebook Auth:无法加载URL:此URL的域未包含在应用的域中 - Facebook Auth: Can't Load URL: The domain of this URL isn't included in the app's domains facebook登录名:无法加载URL:该URL的域未包含在应用程序的域中 - facebook login : Can't Load URL: The domain of this URL isn't included in the app's domains 无法加载 URL:此 URL 的域未包含在应用程序的域中。 为了能够加载这个 URL... Codeigniter - Can't Load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL… Codeigniter Facebook App - 此URL的域名未包含在应用程序的域中。 为什么? - Facebook App - The domain of this URL isn't included in the app's domains. Why? Facebook身份验证,严格的OAuth模式:此URL的域不包含在应用程序的域中 - Facebook Authentication, Strict OAuth Mode: The domain of this URL isn't included in the app's domains Facebook登录:该应用程序的域中未包含URL! 我收到错误> FacebookClient.php中的可捕获致命错误 - Facebook Login: URL isn't included in the app's domains! I get error > Catchable fatal error in FacebookClient.php 无法加载网址:此网址的域未包含在应用程序的域中 - Unable to load URL: This URL's domain is not included in the app's domain URL 正则表达式验证:如果 URL 中没有 3 个 W,则拒绝 - URL regexp validation: deny if there isn't 3 W's in URL 操作无法加载正确的页面(网址) - Action can't load the correct page (url)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM