title: facebook oauth url problems
body: <p>I have the following code, which are working partly</p>
  
  <pre><code>&lt;?php
  
     require_once 'facebook.php';
  
     $app_id = 'MY_APP_ID';
     $app_secret = 'MY_APP_SECRET';
     $app_url = 'http://mysite.com/index.php/';
     $scope = 'user_about_me';
  
     // Init the Facebook SDK
     $facebook = new Facebook(array(
       'appId'  =&gt; $app_id,
       'secret' =&gt; $app_secret,     
       'cookie' =&gt; true
     ));
  
     // Get the current user
     $user = $facebook-&gt;getUser();
  
     // If the user has not installed the app, redirect them to the Auth Dialog
     if (!$user) {
       $loginUrl = $facebook-&gt;getLoginUrl(array(
         'scope' =&gt; $scope,
         'redirect_uri' =&gt; $app_url,
       ));
  
       print('&lt;script&gt; top.location.href=\'' . $loginUrl . '\'&lt;/script&gt;');
     } 
  
      $user_profile = $facebook-&gt;api('/me');
      echo "id: " . $user_profile['id'];   
  
   ?&gt;
  </code></pre>
  
  <p>I get the correct id printed out on this page, but on several other pages i go into the if(!$user).</p>
  
  <p>But there is an error in the oauth url:</p>
  
  <p>API Error Code: 191
  API Error Description: The specified URL is not owned by the application
  Error Message: Invalid redirect_uri: Given URL is not allowed by the Application configuration.</p>
  
  <p>I have found similar problems here on stackoverflow, but can't seem to fix it :/</p>
  
  <p>Under my settings I have the same url and $app_url</p>
  
  <p>Website with facebook -> site url -> <a href="https://www.facebook.com/pages/myappname/373671679372127/" rel="nofollow">https://www.facebook.com/pages/myappname/373671679372127/</a></p>
  
  <p>EDIT: I edit my app_url, so it is now the same as my canvas url under app settings: <a href="http://mysite.com/index.php/" rel="nofollow">http://mysite.com/index.php/</a></p>
  
  <p>Now I don't get an error. I just get a blank window :(</p>
  
  <p>EDIT: Importent to clear cookies once a while when testing. Else some very random errors somewhere</p>