Facebook API error 191

前端 未结 11 1886
面向向阳花
面向向阳花 2020-11-22 10:20

I\'m trying to integrate my project with Facebook. I\'m taking baby steps at first and just trying to login, get a Facebook session, and get some user data. I\'m developing

相关标签:
11条回答
  • 2020-11-22 10:35

    I have noticed also that even if you specify your website under secion - Website With Facebook Login -> Site url as e.g. http://example.com, but if your App Domains section is empty, and you open website as www.example.com you will get this error, too. To avoid it in "App Domains" section write example.com, that will allow subdomains, like www.example.com, something.example.com etc

    0 讨论(0)
  • 2020-11-22 10:37

    Something I'd like to add, since this is error 191 first question on google:

    When redirecting to facebook instead of your own site for a signed request, you might experience this error if the user has secure browsing on and your app does redirect to facebook without SSL.

    0 讨论(0)
  • 2020-11-22 10:38

    Had the same problem:

    $params = array('redirect_uri' => 'facebook.com/pages/foobar-dev');
    $facebook->getLoginUrl($params);
    

    When I changed the redirect_uri from the devloper page to the live page, 191 Error came up.

    So I deleted the $params:

    $facebook->getLoginUrl();
    

    After the app-request now FB redirects to the app url itself f.e.: my.domain.com

    What I do now is checking in index.php of my app if I'm inside FB iframe or not. If not I redirect to the live FB page f.e.:

    $app = 'facebook.com/pages/foobar-live';
    $rd = (isset($_SERVER['HTTP_REFERER'])) ? parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST) : false;
    if ($rd == 'apps.facebook.com' || (!isset($_REQUEST['signed_request'])))  {
        echo '<script>window.parent.location = "'.$app.'";</script>';
        die();
    }
    
    0 讨论(0)
  • 2020-11-22 10:42

    in the facebook App Page, goto the basic tab. find "Website with Facebook Login" Option.

    you will find Site URL: input there put the full URL ( for example http://Mywebsite.com/MyLogin.aspx ). this is the URL you can use with the call like If the APP ID is 123456789

    https://graph.facebook.com/oauth/authorize?client_id=123456789&redirect_uri=http://Mywebsite/MyLogin.aspx&scope=publish_actions

    0 讨论(0)
  • 2020-11-22 10:48

    For me it's the Valid OAuth Redirect URIs in Facebook Login Settings. The 191 error is gone once I updated the correct redirect URI.

    0 讨论(0)
提交回复
热议问题