41

I'm trying to get access token from user

string response_script = "<script>top.location.href='https://www.facebook.com/v2.4/dialog/oauth?response_type=token&client_id=[APPLICATION ID]&redirect_uri=https://www.facebook.com/[APPLICATION URL]/?sk=app_[PAGE ID]&scope='; </script>";

But I'm getting an error:

Can't Load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and subdomains of your app to the App Domains field in your app settings.

That code works well. So I think that needs to add my url to

Valid OAuth redirect URIs

But It doesn't exists in advanced section anymore. facebook changed it's design and now it looks like this. It's too big image and because I have it in out of stackoverflow

What can I do?

live-love
  • 48,840
  • 22
  • 240
  • 204
gsiradze
  • 4,583
  • 15
  • 64
  • 111
  • I think that section shows up dynamically, depending on whether you have a platform configured that those settings apply to. – CBroe May 17 '16 at 09:44
  • @CBroe it's page tabs app – gsiradze May 17 '16 at 09:44
  • Then the section should show up under Advanced. (Just tested it, created a new app, configured Page Tab platform – and the settings are available under Advanced, as expected.) – CBroe May 17 '16 at 09:48
  • @CBroe I'v added Page Tab and Website in Basic and when I go to advanced there is same result as in my picture (see in question). for you is it same? – gsiradze May 17 '16 at 10:10
  • 1
    Somewhat confusingly, this error can also occur when "Use Strict Mode for Redirect URIs" is enabled in the "Facebook Login" settings (under Products), and the "Valid OAuth redirect URIs" field does not contain the exact URI that you're using as your Redirect URI, including path. – Tobias Cohen Nov 02 '17 at 02:50
  • Thanks to @TobiasCohen and to whoever still struggling: yes, this (require EXACTLY matching Valid OAuth redirect URIs such as "https://yourdomain.com/auth/facebook/callback") is the reason blocking me for 2 days! Just having https://yourdomain.com won't work! Thanks. – Paul Wang Mar 20 '18 at 02:03

5 Answers5

55

I had the same issue as you, I figured it out. Facebook now roles some features as plugins. In the left hand side select Products and add product. Then select Facbook Login. Pretty straight forward from there, you'll see all the Oauth options show up.

Neo
  • 11,078
  • 2
  • 68
  • 79
  • Thank you! That's working good. Strange that I should add link like https://apps.facebook.com/123456789 to the valid links – Ivan Yuriev Jul 29 '16 at 09:34
  • 1
    Client OAuth login is enabled but you haven't listed any valid OAuth redirect URIs. Click here for more information. this error coming. any solution – Chirag thaker Nov 09 '16 at 11:23
  • 1
    Thanks Neo, saved my day! – Haifeng Zhang Jul 26 '17 at 21:55
  • This is happening also with Strict Mode activated. Some apps have this option locked so make sure to read this: https://developers.facebook.com/docs/facebook-login/security/ – develCuy May 17 '18 at 01:40
42

Like the other answer says, in the left hand side select Products and add product. Then select Facbook Login.

I then added http://localhost:3000/ to the field 'Valid OAuth redirect URIs', and then everything worked.

leevigilstroy
  • 594
  • 5
  • 11
21

Adding my localhost on Valid OAuth redirect URIs at https://developers.facebook.com/apps/YOUR_APP_ID/fb-login/ solved the problem!

And pay attention for one detail here:

In this case http://localhost:3000 is not the same of http://0.0.0.0:3000 or http://127.0.0.1:3000

Make sure you are using exactly the running url of you sandbox server. I spend some time to discover that...

enter image description here

mourodrigo
  • 2,232
  • 28
  • 18
0

I had the same problem, and it came from a wrong client_id / Facebook App ID.

Did you switch your Facebook app to "public" or "online ? When you do so, Facebook creates a new app with a new App ID.

You can compare the "client_id" parameter value in the url with the one in your Facebook dashboard.

Also Make sure your app is public. Click on + Add product Now go to products => Facebook Login Now do the following:

Valid OAuth redirect URIs : example.com/

0

If you are using AWS, go to Facebook Developers console - https://developers.facebook.com/

You need to add the URL from User Pools > App Integration > Amazon Cognito domain, and add /oauth2/idpresponse to it, for example:

https://myappxxxxx-xxxx-dev.auth.us-east-2.amazoncognito.com/oauth2/idpresponse

enter image description here

live-love
  • 48,840
  • 22
  • 240
  • 204