title: Facebook API redirect_ui error
body: <p>I'm implementing a new app that uses Facebook login:<br>
  On developers.facebook.com I set the Settings:<br>
  App Domains: (empty)<br>
  Site URL: <a href="http://localhost/site/" rel="nofollow">http://localhost/site/</a><br>
  Client OAuth Login: Yes<br>
  Web OAuth Login: Yes<br>
  Force Web OAuth Reauthentication: No<br>
  Embedded Browser OAuth Login: No<br>
  Valid OAuth redirect URIs: <a href="http://localhost/site/externallogin/" rel="nofollow">http://localhost/site/externallogin/</a></p>
  
  <p>And in my app the login link:</p>
  
  <pre><code>$facebook = new Facebook\Facebook([
    'app_id' =&gt; FB_APP_ID,
    'app_secret' =&gt; FB_APP_SECRET,
    'default_graph_version' =&gt; 'v2.5',
  ]);
  
  $helper = $facebook-&gt;getRedirectLoginHelper();
  $permissions = ['email', 'public_profile', 'user_friends'];
  $loginUrl = $helper-&gt;getLoginUrl("http://localhost/site/externallogin", $permissions);
  echo '&lt;a href="' . htmlspecialchars($loginUrl) . '"&gt;Log in with Facebook!&lt;/a&gt;&lt;hr&gt;';
  </code></pre>
  
  <p>And my externallogin page:</p>
  
  <pre><code>$helper = $facebook-&gt;getRedirectLoginHelper();
  
  try {
      $accessToken = $helper-&gt;getAccessToken();
  } catch(Facebook\Exceptions\FacebookResponseException $e) {
      // When Graph returns an error
      echo 'Graph returned an error: ' . $e-&gt;getMessage();
      exit;
  } catch(Facebook\Exceptions\FacebookSDKException $e) {
      // When validation fails or other local issues
      echo 'Facebook SDK returned an error: ' . $e-&gt;getMessage();
      exit;
  }
  </code></pre>
  
  <p>But When I'm redirect I got the following error:</p>
  
  <blockquote>
    <p>Graph returned an error: Error validating verification code. Please
    make sure your redirect_uri is identical to the one you used in the
    OAuth dialog request</p>
  </blockquote>
  
  <p>I've tried to change default_graph_version to 2.2, change the Valid OAuth redirect URIs and the return url to all kinds, but nothing, the same.<br>
  I've read everything related with this and tried all the approach, but still the same.<br>
  I don't know what can be causing this error.</p>
  
  <p>My question is: How can I fix this error I get the the access token correctly.
  <a href="http://i.stack.imgur.com/yuJLa.png" rel="nofollow">print 1</a>
  <a href="http://i.stack.imgur.com/VNBzM.png" rel="nofollow">print 2</a></p>