1

Users on my site can login with Facebook from this page: https://www.wonderweddings.com/login

However, I'm getting the 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.

I checked these posts to see what I could do:
How to turn off "Use Strict Mode for Redirect URIs" in facebook app
Facebook OAuth "The domain of this URL isn't included in the app's domain"

So I added what I thought were all possible URLs, but I keep getting the same error. Whether I disable or enable "Enforce HTTPS" does not matter. I also tried with "Embedded Browser OAuth Login" enabled and disabled.

https://www.wonderweddings.com/login.aspx
https://www.wonderweddings.com/login.aspx?loggedin=true&scope=email
https://www.wonderweddings.com/login
https://www.wonderweddings.com/login?loggedin=true
https://www.wonderweddings.com:443/login.aspx
https://www.wonderweddings.com:443/login.aspx?loggedin=true&scope=email
https://www.wonderweddings.com:443/login
https://www.wonderweddings.com:443/login?loggedin=true

I also tested if appId or app secret was changed due to saving, but that is not the case either.

I have a copy of this site running on another domain. This domain connects to another app, but other than that has similar settings, only this other app still has the setting "Use Strict Mode for Redirect URIs" disabled. There my code works perfectly. So I'm sure it's something I'm missing on Facebook with these settings.

My settings: enter image description here

What else can I try?

Adam
  • 6,041
  • 36
  • 120
  • 208

2 Answers2

3

The login button on your site is currently loading this URL: https://www.facebook.com/v2.8/dialog/oauth?client_id=143381855734017&redirect_uri=https://www.wonderweddings.com/login.aspx?loggedin=true&scope=email

Facebook receives these query parameters:

client_id = 143381855734017
redirect_uri = https://www.wonderweddings.com/login.aspx?loggedin=true
scope = email

So the callback they are expecting is probably: https://www.wonderweddings.com/login.aspx?loggedin=true

Note that to be safe, the callback parameter should be URL encoded so that special characters are handled correctly (: / ? = all mean something in URLs)

You should change your site so that the link it opens is: https://www.facebook.com/v2.8/dialog/oauth?client_id=143381855734017&redirect_uri=https%3A%2F%2Fwww.wonderweddings.com%2Flogin.aspx%3Floggedin%3Dtrue&scope=email

dtyler
  • 1,398
  • 2
  • 15
  • 21
0

There has been Facebook update in October 2017. Use Strict Mode for Redirect URIs is now always enabled in Facebook App dashboard.

Solution in my case was related to that update: make sure that Valid Oauth redirect URIs input contains the same URI as provided in redirect_uri param.

azurecorn
  • 395
  • 5
  • 12