-1

Whenever i tried to login with facebook i'm getting the following error.

Insecure login Blocked. You cant get access token or log in to this app from insecure page. Try re-loading the page as https://

This code is in my localhost.

And this the url i'm using http://localhost/php-facebook-login/login.php same url only i have given in the facebook app configuration page.

Please help me to rectify this issues.

Thank you.

gunaerode
  • 33
  • 9

1 Answers1

-1

Since March 2018 Facebook requires redirect URIs to be served using HTTPS by default. The toggle is called "Enforce HTTPS". See Facebook's manual for more details Facebook Login Security

As the commenters pointed out the redirect will work even for localhost. But I am not sure if Facebook will accept a self signed certificate.

Markus Müller
  • 2,611
  • 1
  • 17
  • 25
  • It can work if you have a localhost certificate, It was working 2 months ago – proofzy Apr 09 '18 at 10:16
  • thank you markus. Is there anyway to test the facebook login instead of live server. – gunaerode Apr 09 '18 at 10:19
  • @proofzy how to get certification for my localhost please tell me – gunaerode Apr 09 '18 at 10:21
  • 1
    We usually set up a dedicated testing environment, with their own domains and certificates. Perhaps you'll find some best practices or advices in Facbook's documentation. https://developers.facebook.com/docs/facebook-login/testing-your-login-flow – Markus Müller Apr 09 '18 at 10:22
  • _“Facebook login will only work, if the redirect URL is available from the internet”_ - absolute nonsense. The redirect happens inside the user’s browser, therefor it also only needs to work there for your local testing. – CBroe Apr 09 '18 at 10:49
  • Corrected the answer – Markus Müller Apr 10 '18 at 09:22