60

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.

I have researched the most popular questions on SO already (Question 1, Question 2, Question 3, Question 4, and Question 5)... None of them help with my situation.

I have the application settings laid out like this...

App Domains: azeverything.com
Sandbox Mode: Disabled
Website with Facebook Login
Site URL: http://azeverything.com

****App Domains*** requires that no protocol be identified and Site URL requires that a protocol be identified.*

I have tried using www.azeverything.com and that didn't work either. Everything seems to match up. By the way, this is a WP site. I'm not developing locally either. It's all live.

Community
  • 1
  • 1
Millhorn
  • 2,953
  • 7
  • 39
  • 77
  • Does your SDK/plugins snippet use the correct App ID? – Simon Boudrias Sep 30 '13 at 17:58
  • Yes. I just verified. Everything's lined up. I even tried a completely different plugin. Still the same error, which tells me it's Facebook. – Millhorn Sep 30 '13 at 18:03
  • Your login button “powered by LoginRadius” opens a URL of the format `https://azeverything.hub.loginradius.com/requesthandlor.aspx?apikey=…`, and that redirects to the login dialog with a `redirect_uri` value of `https://azeverything.hub.loginradius.com:443/socialauth/validate.sauth` – and that _is not_ your app domain at all. So go ask “LoginRadius” how that is supposed to work. – CBroe Oct 29 '13 at 13:40
  • you might want to clarify whether you are embedding a like button or allowing users to login using facebook. Which of the two top voted answers below applies depends on that. – Ed Sykes Jul 01 '15 at 11:01

16 Answers16

83

Try to check at Settings > Advanced. At Valid OAuth redirect URIs, make sure you have a correct domain.

Hope it works.

hd1
  • 33,938
  • 5
  • 80
  • 91
Phat H. VU
  • 2,350
  • 1
  • 21
  • 30
  • 19
    Could someone elaborate on this answer? It has a lot of upvotes, but I think there might be some language barrier. I don't know what 'make sure you have a correct domain of let it empty' means. What should that value be? – thumbtackthief May 18 '14 at 20:12
  • 2
    It means you have to double check that this option contains the exact domain of your application. If you leave it empty all domains will be accepted – coorasse Jul 22 '14 at 09:25
  • 1
    @thumbtackthief If it's empty, your app will accept authorization requests from any site. If you clear that field and it works, then you know you have the wrong value there. – Michael Blackburn Feb 07 '15 at 21:13
  • this works if you are using facebook as an oauth login provider – Ed Sykes Jul 01 '15 at 11:01
  • 1
    Cannot leave it empty - fb throws an error message - cannot save settings – Armand P Nov 09 '15 at 15:35
25

You need to add the URL to your app:

  1. Go to the app, you want for user login, on the Facebook Developers page
  2. Click on the settings tab
  3. Click add platform
  4. Select Website
  5. After selection it will ask for some details such as URL for your website which uses login with facebook feature, fill the form and submit it

That's all and you are done. Make sure that the app's URL is the same from where you're logging in.

Hitesh
  • 379
  • 4
  • 11
8

Under Basic settings:

  1. Add the platform - Mine was web.
  2. Supply the site URL - mind the http or https.
  3. You can also supply the mobile site URL if you have any - remember to mind the http or https here as well.
  4. Save the changes.

Then hit the advanced tab and scroll down to locate Valid OAuth redirect URIs its right below Client Token.

  1. Supply the redirection URL - The URL to redirect to after the login.
  2. Save the changes.

Then get back to your website or web page and refresh.

gakuru
  • 111
  • 3
  • 6
5

This is a basic breakdown for slow people like me, and I didn't see this mentioned before.

The "redirect uri" isn't the place where you're redirecting to, but where it's coming from.

Say you have your app at http://myFBapp.com listening to /auth/facebook, and after they log in, redirecting them to /UserLoginHooray. The "Valid OAuth redirect URIs" should read http://myFBapp.com/auth/facebook, not http://myFBapp/UserLoginHooray.

Explanation: HTTP Requests that have been redirected (302) include the original address in the header, so Facebook is merely putting a very basic layer of security on the request.

Michael Blackburn
  • 3,161
  • 1
  • 25
  • 18
  • +1 for explanation. I have several clients using my PHP application, but only one of them was getting this error and it only happened after he got a new mac. When I put in the full URI (e.g. ihttp://app.my-page.com/full/uri/value) in "Valid OAuth redirect URIs", it suddenly worked. Ty! – ray Feb 10 '15 at 02:48
  • 1
    Fantastic! After an hour or two of hunting around and trying things, THIS, THIS and the wonderful explanation solved my problem. I now have another but that's java code related. You, sir, are awesome. – null Nov 07 '15 at 20:35
4

I chased my tail on this issue for hours. My coder and I could login with FB without a problem but my wife couldn't. She would get this topic's subject message. I tried every setting and URL that I could think of for my Lavarel app.

My issue was that my wife was signing in from:

http://www and we were using http://  

A short trip to CPanel and a redirect fixed that. Hope this helps someone!

For Lavarel these FB app settings worked for me:

Settings/Basic - App Domain: mydomain.com ,  Site URL: http://mydomain.com/login.

Settings/Advanced - Client OAuth Login: Yes. 

Settings/Advanced - OAuth redirect URIs: http://mydomain.com , http://mydomain.com/login.

App Details/App Center listed platforms = No.  I'm only using the login for now.
Preston
  • 3,260
  • 4
  • 37
  • 51
3

I have a website with facebook login.
It has been stable and working for months. No code change has happened for weeks. Then, suddenly, the facebook login gives an error message:

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.

After debugging "for awhile", I reset my facebook app secret and it started to work again!

TaiwanGrapefruitTea
  • 1,045
  • 2
  • 14
  • 25
2

Michael Blackburn's answer helped me resolve my issue, but I want to give more detail on my fix.

I have a php app that posts to a user's FB page.

I own two domains:

I built my site off the first domain because it read better IMHO (at least it did at the time).

Some users typoed the url so I bought the second one with no dashes for that reason.

So, one of my users was having the "Given URL" error.

Turns out he was going to http://app.mywebapp.com and the rest of them were going to http://app.my-web-app.com

I fixed everyone by adding all possible redirect URIs: enter image description here

Granted, there are 100 better ways to implement this, but here is the workaround for now.

ray
  • 8,521
  • 7
  • 44
  • 58
2

1.Make Sure Website Url and platform added, if not then visit https://developers.facebook.com/quickstarts/ then Select Platform -> Setup SDK -> Website Url And so on..

Note: website url can't be like this : https://www.example.com just remove www and make it simple and working ;)

2.Goto App Dashboard -> Setting -> Click on Advanced Tab then go to bottom of the page and enable Embedded Browser OAuth Login and leave Valid OAuth redirect URIs blank and Save it

2

I found Valid OAuth Redirect URIs under PRODUCTS then Facebook Login > Settings not as everyone is stating above. I am supposing this is a version issue.

It still didn't work for me. I guess I really have to add Android Platform rather than just the Website. This is annoying because my app is still in development mode :(

UPDATE: I'm using Expo to develop my react-native app and used info provided here: https://developers.facebook.com/apps/131491964294190/settings/basic/ to set up the Android and iOS platforms. This resolved the issue for me.

Master Ace
  • 69
  • 2
  • 4
1

Sometimes this error occurs for old javascript sdk. If you save locally javascript file. Update it. I prefer to load it form the facebook server all the time.

Md. Yusuf
  • 502
  • 2
  • 6
  • 20
1

Go to facebook developer dashboard Select settings -> select WEB(for website) -> Add platform Add your site URL.

This should resolve your issue.

user3059993
  • 324
  • 1
  • 4
  • 9
1

So... facebook distinguishes pretty harshly between http and https in your app. This is just another small thing to check if you run into trouble.

Joe Susnick
  • 6,544
  • 5
  • 44
  • 50
0

I solved this issue by specifying correct site URL in my App Settings. It works fine now. You have to specify your website Url such as http://www.xyz.com/

Sagar Bhosale
  • 407
  • 1
  • 5
  • 19
0

Under advanced tab make sure "Valid OAuth redirect URIs" contains valid URI or leave it empty(not recommended)

"http://example.com/"

instead of

"http://www.example.com"

Parvindra Singh
  • 53
  • 2
  • 10
0

sometimes you need to check your code (the part of redirect)

$helper = new FacebookRedirectLoginHelper('https://apps.facebook.com/xxx');
$auth_url = $helper->getLoginUrl(array('email', 'publish_actions'));
echo "<script>window.top.location.href='".$auth_url."'</script>";

if any changes happens there (for example, the name of your application "https://apps.facebook.com/xxx" in relation the application settings in facebook, you will get the above error

0

For Android Developers,

Make sure you have enabled Facebook Login inside the Products list inside Dashboard of your Facebook project app and have added all the required details as you go through the whole flow.

The login should work without giving the same error.

devDeejay
  • 5,494
  • 2
  • 27
  • 38