Given URL is not allowed by the Application configuration

136,819

Solution 1

The problem is that whatever url you are currently hosting your app is not setup in your Application configuration. Go to your app settings and ensure the urls are matching.

Updated

Steps:

  1. Go to 'Basic' settings for your app
  2. Select 'Add Platform'
  3. Select 'Website'
  4. Put your website URL under 'Site URL'

enter image description here

Solution 2

This can also happen when the redirect_uri submitted with the https://www.facebook.com/dialog/oauth request is not present in the list of Valid OAuth redirect URIs under:

  • Settings >> Advanced >> Security

After much trial and error, when I added the redirect_uri that I was using (https://www.facebook.com/connect/login_success.html in my case), I suddenly got to the step past this error.

Solution 3

The above answers are right, but you have to make sure you input right URL.

You have to go to: https://developers.facebook.com/apps

  1. Select your app
  2. Click settings
  3. Enter contact email (for publishing)
  4. Click on +add platform
  5. Add your platform (probably WEB)
  6. Enter site URL

You have two choices to enter: http://www.example.com or http://example.com

Your app will work only with one of them. In order to make sure your visitors will use your desired url, use .htaccess on your domain.

Here's good tutorial on that: http://eppand.com/redirect-www-to-non-www-with-htaccess-file/

Enjoy!

Solution 4

Go to your application, settings (basic tab) and add platform (website). Type your site url and done.

Solution 5

Do the above work of adding the site and then the url. I think the layout of facebook has changed little bit so also do the below things. - Go to developers.facebook.com -> your app - Go to Settings->Advanced. - Under the Security->Valid OAuth redirect URIs, insert all the uri's your app is supposed to redirect to. For example ( http://localhost:1443/cas/login, https://localhost:2443/cas/login, http://rajanpupa.com/cas/login etc) - That should do it.

Share:
136,819
Slazer
Author by

Slazer

Updated on March 10, 2020

Comments

  • Slazer
    Slazer about 4 years

    I am trying to create facebook sign-in page according to this tutorial. I only changed the two lines

    appId      : '370675846382420', // App ID
    channelUrl : '//http://bp.php5.cz/channel.html', // Channel File
    

    and I get the following error

    Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.

    What might be the problem?

  • Kyasa Madhavi
    Kyasa Madhavi almost 11 years
    I did same as you said above .developers.facebook.com/apps/myappid/summary?ref=nav.Here i have mention "example.com" in "App Domains" , and "Website with Facebook Login" - Site URL: is "htttp://example.com" and my html page in which I am calling FB.getLoginStatus is placed at example.com/facebookEX4.htm. But still I am gettting same error. Could you tell me what i am missing still ?
  • Alkanshel
    Alkanshel over 10 years
    This can happen if you're testing an app on localhost that's configured in fb to work with www.mysite.com. Go to your hosts file and point www.mysite.com to your ip, and then test it on mysite.com (which will be your dev environment)
  • SJG
    SJG about 10 years
    For me the fix was registering the FULL url! mysite.com/somefolder/somepage.php
  • Vexter
    Vexter about 10 years
    Make sure to also put in a port number if you're not using port 80 in localhost server. I'm using 9000 so I had to put in mysite.com:9000 to get it to function
  • Ritesh A
    Ritesh A almost 10 years
    This is the answer I was looking for.
  • Grasper
    Grasper over 9 years
    what if I don't want it to be tied to my URL? I'm making WP plugin and they will host it on their domain.
  • Codecat
    Codecat over 9 years
    Thanks, this was my case. Seems like login_success.html used to work fine without manually approving it, but they "recently" changed it or something.
  • RPDeshaies
    RPDeshaies about 9 years
    Is it possible to register multiple urls ? dev, staging, prod, etc. ?
  • Shade
    Shade about 9 years
    Hey, what about the part with the "...or the domain must be a subdomain of one of the App's domains"? Is this not valid for sharing from websites?
  • jimjamslam
    jimjamslam over 8 years
    When I click Add Platform, Website is greyed out.
  • Mario
    Mario over 8 years
    This is super important to remember. The OAuth Redirect URI and the Site URL must be consistent! +1
  • Michal Hosala
    Michal Hosala over 8 years
    Also review Armand's answer below. It cost me quite some time to realize logins are failing occasionally when users type www.mydomain.com into browser instead of just mydomain.com. Had to apply some URL rewrite rules on the server.
  • Oscar Ortiz
    Oscar Ortiz over 8 years
    @David Alpert you are the man, I can't believe these details aren't always mentioned in tutorials around the web (Android/SDK/Xamarin)
  • Remya R
    Remya R about 8 years
    my issue is this can any one help me 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.
  • Remya R
    Remya R about 8 years
    What for this? 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. also it is working in some browsers
  • code-8
    code-8 about 8 years
    What should I add into the site URL, if I don't have the public domain name yet, but I have the ip address of my VM that running my site. Can anyone please advise ?