Php-graph-sdk: Error 191: The domain of this URL is not included in the application domains

Created on 16 Jul 2018  Â·  3Comments  Â·  Source: facebookarchive/php-graph-sdk

pt_BR:
Facebook Graph returned an error: Não é possível carregar a URL: O domínio dessa URL não está incluído nos domínios do aplicativo. Para poder carregar essa URL, adicione todos os domínios e subdomínios ao campo Domínios do aplicativo nas configurações do aplicativo

Funciona na versão da API 2.10 mais nao na 3.0. Atualizei php SDK para 5.6.3 e configurei Domínios do aplicativo e continuo recebendo o mesmo erro (191).
Alguma idéia?

en_US:
Facebook Graph returned an error: Unable to load URL: The domain of this URL is not included in the application domains. In order to load this URL, add all domains and subdomains to the Application Domains field in the application settings

It works in API version 2.10 but not in 3.0. I upgraded php SDK to 5.6.3 and added my domain to Application Domains to no avail. error (191).
Any idea ?

Most helpful comment

Assuming you have correct entries in App Domains and you're using Facebook Login, you need to add the exact callback url to the "Valid OAuth Redirect URIs" section under the Facebook Login->Settings. The error you get from FB is misleading and really doesn't have to do with your App Domain entries.

All 3 comments

Assuming you have correct entries in App Domains and you're using Facebook Login, you need to add the exact callback url to the "Valid OAuth Redirect URIs" section under the Facebook Login->Settings. The error you get from FB is misleading and really doesn't have to do with your App Domain entries.

What resolved this issue for me was including the callback url inside of the getAccessToken() function. For example... previously I was using

  $helper = $fb->getRedirectLoginHelper();

  try{
    $accessToken = $helper->getAccessToken();
  }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;
  }

I then modified to $helper->getAccessToken() function to include my redirect URI.

  $helper = $fb->getRedirectLoginHelper();

  try{
    $accessToken = $helper->getAccessToken(<insert redirect URI here>);
  }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;
  }

closing as there is no activity. Thanks @wilso199 for the proposed solution

Was this page helpful?
0 / 5 - 0 ratings

Related issues

igor84 picture igor84  Â·  8Comments

flyingcoder picture flyingcoder  Â·  8Comments

lbeier picture lbeier  Â·  3Comments

severin-bruhat picture severin-bruhat  Â·  3Comments

mohsenshakibafar picture mohsenshakibafar  Â·  4Comments