Cannot test Facebook OAuth in development because 'Valid OAuth Redirect URIs' not allowing localhost - facebook

In Facebook Login Settings (in Valid OAuth Redirect URIs), when I attempt to add http://localhost:8000/survey, I get the following message,...,
http://localhost redirects are automatically allowed while in development mode only and do not need to be added here.
So, when I attempt to use http://localhost:8000/survey in my redirect_uri= parameter on my https://www.facebook.com/v7.0/dialog/oauth?client_id=... URL for FB login, I get this error message on the FB login page:
URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs.
Okay,... so I'm not allowed to whitelist http://localhost:8000/survey by adding it to Valid OAuth Redirect URIs -- where it says that http://localhost redirects are automatically allowed -- but then when I actually use a localhost URL, it is not whitelisted.
How is it possible test my app's FB login in a localhost/development environment? (I'm familiar with ngrok, but is there another way besides that?)

The first part you quoted mentions the app being set in Development Mode:
http://localhost redirects are automatically allowed while in development mode only and do not need to be added here.
You can toggle this from the top right corner of your App Dashboard on Facebook's site. More detailed instructions here: https://developers.facebook.com/docs/apps/managing-development-cycle/#step1
Another alternative that you have is using your hosts file to point a domain name to your localhost, if you can't set your app in development mode.

Related

URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s

Good morning everyone,
For a few days I have been failing to log in with facebook on my website made with WordPress.
The error message I get is the following:
"URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs."
I have tried creating a new Facebook login app and get exactly the same error window.
Can someone please try what is the problem?
encontinuo.com/login
I attach the screenshots with the error and the URI configuration that I have applied in the Facebook login app.
Thank you very much.
Facebook connect button
URIs error
URIs config

Facebook login flutter app error

I have encountered the following FB error:
Given URL is not allowed by the application configuration: One or more
of the given URL is not allowed by the App's settings. To use this URL
you must add a valid native platform in your App's settings.
Also Facebook OAuth redirect URI, does not accept http local host.
You may need to review the OAuth settings for your Facebook application
Also Facebook OAuth redirect URI, does not accept http local host
HTTPS is required for new Facebook integrations. You can get free certificates from Lets Encrypt or use self-signed certs and add them to your mobile device. It's a little more complicated, but it's really for the best :-)

Meteor accounts-facebook not working on server

I have followed the this tutorial (http://bulenttastan.net/login-with-facebook-using-meteor-js/) to setup Meteors accounts-facebook package. The application worked fine while working on the local environment(localhost).
Now that I have hosted the app on my server I have the following configuration on my Facebook Apps Dashboard.
But when I try to login from my application I receive the following error message:
"URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs."
My app is hosted on the port '3002' so, I have set the port along with the domain name on the Site URL section on facebook and with respect to the site URL I have also set the redirect URI as given on the image.
Thanks in Advance.
Found a Fix! Setting the ROOT_URL environment variable did the trick for me.

accounts-facebook fails with SecurityError when the site uses SSL

My meteor app has so far lived "unsecured" - meaning no redirection to https:// by default. This has worked fine in conjunction with the accounts-facebook package, which creates its own SSL enabled connection to Facebook when doing its OAuth magic.
My problems started when I tried acessing my site using https instead of http. The pop-up window the accounts package opens to log into facebook halts quickly and by reading its console output I can see the following message
Uncaught SecurityError: Blocked a frame with origin "http://wishlist-foobar.meteor.com" from accessing a frame with origin "https://wishlist-foobar.meteor.com". The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "https". Protocols must match.
I thought this might have something to do with the site url in the app's facebook settings, but changing the http to https in that setting got me nowhere. Still got the same message. How is this supposed to work? I am not hardcoding the http part of the path anywhere except the facebook settings, so this seems to be something the accounts-facebook package is doing.
This is my app settings on Facebook. Observe the non-SSL site url.
It turns out you need to set the ROOT_URL environment variable for the callbacks to work and make sure visitors hit that url (for instance, forcing ssl). See these SO answers for more background info.
Google OAuth login in http server
Why is ROOT_URL a required environment variable for bundle deployment?

Setting up Facebook App Domain as IP Address

I have a login with facebook on my website which I was testing locally on localhost. Now I have put it on a server and I am trying to change the facebook app configuration so I could make the login. Before I had:
App Domain:
localhost
Site URL:
http://localhost/
Mobile URL:
http://localhost/
Now I am trying to change localhost for my website IP address: 107.170.**.**7:8776, so first I set the Site URL and Mobile URL to http://107.170.**.**7:8776/ but when I try to set the App domain to 107.170.**.**7:8776 I get an exclamation saying:
This must be derived from Canvas URL, Secure Canvas URL, Unity Binary URL, Site URL, Mobile Site URL, Page Tab URL or Secure Page Tab URL. Check and correct the following domains: 107.170.**.**7:8776
What am I missing here?
Thanks in advance.
Facebook appears to require a valid domain instead of an IP address. Not sure why, as they don't mention this in the facebook developer docs anywhere (from what I can tell)
More info:
facebook Error App Domain: [IP Address] is not a valid domain.?