I know many such questions have already been asked tried a lot then after posting the question. My Problem is still unresolved.
I have a web application where I embedded the Facebook login using Oauth Authentication. I used the following code for help Facebook login with Java
Till last month it was working fine but from few days we are coninuously 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.
**Setting used are following:-
  Website url : **https://www.enggheads.com/**
  App Domain   :  **enggheads.com**
   Redirect uri : 
      1. https://www.enggheads.com/#!login
      2. https://www.enggheads.com/#!signup**
SCREENSHOTS:



So, I just want to know whats the issue why I am facing this problem. Is there something which I am missing in the settings section?
Code flows :
Step1. On button click url called--->
"http://www.facebook.com/dialog/oauth?" + "client_id="
                    + FB_APP_ID + "&redirect_uri="
                    + URLEncoder.encode(REDIRECT_URI, "UTF-8")
                    + "&scope=public_profile ";
I am receiving error on this very part where it gives 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.
In the "Facebook Login" tab under your app, enter all valid callback URL's, such as http://localhost/callback, http://productionUrl/callback, etc. If you don't see "Facebook Login" tab under your app, click "Add Product-> Facebook Login->Get Started" Enter the Valid Callback Urls -> Save changes.
Try refreshing your browser or reopening the site; on a mobile app, close and reopen the app. You can also check to see if Facebook is offline and then restart your device, update apps, and clear your cache. Visit Insider's Tech Reference library for more stories.
I want to share 2 ways for making solution. Hope it will solve your issue.
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.
OR,
Select Products and add product. Then select Facbook Login.
Then added http://localhost:3000/ to the field 'Valid OAuth redirect URIs', and then everything worked.
It usually happens if you have entered the wrong details when you created the App in Facebook. Or have you changed a URL's of an existing App?
Can you please recheck the settings of your APP in this page?
https://developers.facebook.com/apps
Credit goes to Lei lionel
I think your access token already expires. So you need to extend access token. For this, please go through this link:
I just want to ask 1 thing more is it possible the app domain error has smthng to do with access token expiration time?
Facebook has an advanced option for obtaining long-lived access tokens for apps that:
If your app is set up like this it should use the process described here to obtain an access token from each client to avoid triggering Facebook's automated spam systems. The end result will be that each client will have its own long-lived access token.
At a high level, this is how you can obtain a long-lived token from the client:
Using a long-lived user access token, make a call to the following endpoint:
https://graph.facebook.com/oauth/client_code?access_token=...&client_secret=...&redirect_uri=...&client_id=...
You need to give input: access_token, client_secret, redirect_uri and client_id.
The response will look something like:
{"code": "...."}
Once you've retrieved the code from Facebook's server you then need to ship it to the client via a secure channel. Once that's done, you need to make a request from the client to this endpoint:
https://graph.facebook.com/oauth/access_token?code=...&client_id=...&redirect_uri=...&machine_id= ...
The call requires the following arguments:
client_id - Yes
code - Yes
redirect_uri - Yes
machine_id - No
{"access_token":"...", "expires_in":..., "machine_id":"..."}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With