Can't Load URL - facebook login on the app - facebook-login

I am trying to implement fb login on my game https://ski-jumps.pl.
I prepared the application (settings below) and the script here: https://ski-jumps.pl/facebook.php
Unfortunately when I try to log in this app, a message is displayed: "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."
What am I doing wrong? Some ideas?
application settings

I had the same problem, struggled for hours. I fixed it by providing following url in the Valid OAuth Redirect URIs of the Facebook Login product
https://mysubdomain.azurewebsites.net/signin-facebook
Regard the signin-facebook, which isn't something I provide. I found this is the url of the Facebook error page.

Related

social django package for facebook signin shows url error

When am using social django package for facebook signin but it shows error as :
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 sub-domains
of your app to the App Domains field in your app settings.
In the fb app urlredirect provided is https://localhost:8000 .
1.Go to Facebook developer page and login
2.Then select your app
3.Go to settings > basics
4.Add App Domains localhost
5.And add Website https://localhost:8000/

Graph returned an error: Can't load URL

I was using Facebook login API since last 8 months and was working fine. Today, without changing any settings or any code the API is returning error.
Graph returned 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 sub-domains of your app to the App Domains field in your app settings.
I don't understand what happened, NOTHING has been changed.
I cross-checked all settings and domain name is also same. App ID and Client secret is also correct.
To solve this problem you should go into:
developers.facebook.com -> your app -> PRODUCTS > Facebook Login -> Settings -> Client OAuth Settings -> Valid OAuth redirect URIs
And add hire valid OAuth redirect URI (URI include also query parameter)
I had the same problem, solve it by updating facebook PHP SDK.

Facebook Social Auth Login: Can't Load URL: The domain of this URL isn't included in the app's domains

I am developing a web application using Django and python-social-auth. I want users to login with Facebook.
I have this in my python settings:
SOCIAL_AUTH_FACEBOOK_KEY = '...'
SOCIAL_AUTH_FACEBOOK_SECRET = '...'
SOCIAL_AUTH_FACEBOOK_SCOPE = ['email']
When my users enter the facebook page where they should provide credentials they see an error like this:
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 Facebook for Developers dashboard I have added "Facebook Login" product and added redirect url:
http://localhost:8000/complete/facebook/
In settings, Website Site URL is set to: http://localhost:8000/ and App Domains is set to localhost.
What am I doing wrong?
BTW this is the url that my users see when the facebook page opens:
https://www.facebook.com/v2.9/dialog/oauth?scope=email&state=HSfkstGUR5028DMhUzfWOSgo6fpPx29E&redirect_uri=http%3A%2F%2Flocalhost%3A8000%2Fcomplete%2Ffacebook%2F%3Fredirect_state%3DHSfkstGUR5028DMhUzfWOSgo6fpPx29E&client_id=...&return_scopes=true
Disable the 'Use Strict Mode for Redirect URIs' setting in your Facebook login app.
OR
Note the redirect_uri=http%3A%2F%2Flocalhost%3A8000%2Fcomplete%2Ffacebook%2F%3Fredirect_state%3DHSfkstGUR5028DMhUzfWOSgo6fpPx29E parameter of generated url.
For some inexplicable reason Facebook requires Valid OAuth redirect URIs setting to be exactly the same as the redirect url.
So use a tool like https://meyerweb.com/eric/tools/dencoder/, decode the url and set Valid OAuth redirect URIs to the full url. I.E:
http://localhost:8000/complete/facebook/redirect_state=HSfkstGUR5028DMhUzfWOSgo6fpPA59E
Upgrading social-auth-core to at least version 1.6.0 should help to resolve this. Among other changes it includes this one:
Default REDIRECT_STATE to False in FacebookOAuth2 backend.
This was changed as a result of issue 141, and it causes redirect URLs to be generated without the redirect_state argument, whose dynamic value makes whitelisting impossible.
Once you've done this, add https://<your-domain>/complete/facebook/ to your OAuth redirect whitelist in the Facebook developer portal.
Facebook doesn't like localhost in the Redirect URI field in the app setup or in the redirect_uri parameter. To workaround it just set something in the field (I use http://myapp.com:8000, then add the entry 127.0.0.1 myapp.com in your /etc/hosts and access the app through the new URL (http://myapp.com:8000).
As of the 4th April 2018, day i face the same issue, the only solution i found is:
Valid OAuth redirect URIs must be set to be exactly the same as the redirect url
More info here: https://developers.facebook.com/blog/post/2017/12/18/strict-uri-matching/

Testing facebook login on django development server

I am trying to integrate facebook login in my django app but everytime I click on facebook login button it gives me an 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.
I my app settings my site url is
http://localhost:8000/
and also in my hosts file localhost have been mapped to 127.0.0.1
how to solve this as I have followed similar questions on stack but none helped a lot.
In your host file, set the localhost:port to the domain you wish to log in from.
Then, set the Facebook app's domain to the domain you've pointed your localhost to.

Changing Facebook Oauth redirect url

In our Java EE app we are invoking the fb oauth flow to get accessToken.
For this purpose we make a call with the callback url to the fb server with app key and secret.
At this moment the same url is provided in the fb app url section.
However, is it possible if we can some how change the redirect url to go to a different server ? I have seen just changing the callback url in the code does not work. Looks like it has to be same in the code as well as in the fb application.
This make very difficult to test or use the same app to try things from two different web servers.
Any advise on this?
This is unfortunately not possible. Just redirect user to your redirect_uri which will redirect you to the correct location
The URL to redirect to after the user clicks a button in the dialog.
The URL you specify must be a URL of with the same Base Domain as
specified in your app's settings, a Canvas URL of the form
https://apps.facebook.com/YOUR_APP_NAMESPACE or a Page Tab URL of the
form https://www.facebook.com/PAGE_USERNAME/app_YOUR_APP_ID
https://developers.facebook.com/docs/reference/dialogs/oauth/
For security reasons you can't change the redirect url. Facebook check that you provide the same redirect url as you gave when you registered the application. The way I solved this was to register one application on facebook for each server.
Here is Solution from Promo Group
One of the options - to add a 2nd domain (address mirror the primary site) in
Settings » Basic tab at the top» Mobile Site URL