title: “URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings.” But works locally
body: <p>I have problem like here <a href="https://stackoverflow.com/questions/37001004/facebook-login-message-url-blocked-this-redirect-failed-because-the-redirect">Facebook login message: &quot;URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings.&quot;</a></p>
  
  <p><a href="https://i.stack.imgur.com/MJPdP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MJPdP.png" alt="enter image description here"></a></p>
  
  <p>I have checked various answers - cant make it work, and they don't give much new - just practically say to add url to that field. </p>
  
  <p>One of them said to "Make sure your App IDs and Secret Keys are correct."
  I found out they were not set, but now admin said he added those so should be ok.</p>
  
  <p>What else to do? How to debug?</p>
  
  <p>"URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs."</p>
  
  <p>It also tells to check Client and Web OAuth to make on, but I have them off to increase security becasue I have read or watched somewhere in facebook documentation. And since login works locally with them turned off, they should be not be needed. I tested by trying to turn them on, but as I expected they don't fix the problem.</p>
  
  <p><strong>Update:</strong>
  Redirect uri parameter is redirect_uri=https%3A%2F%2Falpha.vop.veracityinsurance.com%2Fconnect%2Ffacebook%2Fcheck</p>
  
  <p>Made a video: <a href="https://www.loom.com/share/88e607aece6b45489214d95ee01bbb0b" rel="nofollow noreferrer">https://www.loom.com/share/88e607aece6b45489214d95ee01bbb0b</a></p>
  
  <p>I have made debug function and pushed it to server which prints provider:</p>
  
  <pre><code>$provider = (array)$this-&gt;clientRegistry-&gt;getClient('facebook_main')-&gt;getOAuth2Provider();
          print_r($provider);
  </code></pre>
  
  <p>And from that class I see app id is correct in server.</p>
  
  <p>config.yml </p>
  
  <pre><code>knpu_oauth2_client:
      clients:
          # the key "facebook_main" can be anything, it
          # will create a service: "knpu.oauth2.client.facebook_main"
          facebook_main:
              # this will be one of the supported types
              type: facebook
              client_id: '%env(CONFIG__OAUTH__FACEBOOK__ID)%'
              client_secret: '%env(CONFIG__OAUTH__FACEBOOK__SECRET)%'
              # the route that you're redirected to after
              redirect_route: connect_facebook_check
              redirect_params: {}
              graph_api_version: v5.0
  </code></pre>
  
  <p>Btw I am using symfony bundle for integration <a href="https://github.com/knpuniversity/oauth2-client-bundle" rel="nofollow noreferrer">https://github.com/knpuniversity/oauth2-client-bundle</a></p>