1

I have the following config.php file sitting at www.sitename.com/facebook/

<?php
  require_once 'library/facebook.php';
  $app_id = "xyz";
  $app_secret ="xyz"
  $facebook = new Facebook(array (
    'appId' => $app_id,
    'secret'=> $app_secret,
    'cookie'=> true
  ));
  if(is_null ($facebook->getUser()))
  {
    header("Location:{$facebook->getLoginUrl(array('req_perms'=>'user_status, publish_stream, user_photos'))}");
    exit;
  }
?>

The site URL used in registering the app is http://www.sitename.com/facebook/

so running this file should direct me to an authorization page...instead i get the following error:

API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.

Can any one explain how to get around this and why this happens?

edorian
  • 38,542
  • 15
  • 125
  • 143
algorithmicCoder
  • 6,595
  • 20
  • 68
  • 117

1 Answers1

1

Reason for error 191:

In Facebook Application Setting, Site URL is not same as REQUEST_URI (Redirecting URL) e.g., if you specified site URL to http://www.sitename.com/facebook/ then you are not allow to redirect to http://www.namesite.com/facebook/

Love Sharma
  • 1,981
  • 1
  • 18
  • 37