How to fix 'Facebook has detected MyApp isn't using a secure connection to transfer information.' error in Laravel
Stefan Bogdanescu
Founder & Senior Architect · 2026-06-29
Title: How to Fix 'Facebook Has Detected MyApp Isn't Using a Secure Connection to Transfer Information.' Error in Laravel
Integrating Facebook login with Laravel and Socialite package can sometimes result in errors, particularly related to secure connections. In this comprehensive guide, we'll walk through the steps to identify and fix this issue.
Causes of the Error
The error 'Facebook has detected MyApp isn't using a secure connection to transfer information.' usually occurs due to one or more reasons: 1. Your local development environment doesn't have an HTTPS certificate installed for your app, which is needed for SSL communications between your web application and Facebook. 2. The Laravel framework configuration or .env file is not set up correctly for secure connections. 3. The Socialite package code or callback URLs are not configured properly. 4. Your local development environment is using the http protocol instead of https, causing Facebook to detect the non-https communication as insecure.Steps to Fix the Error
To resolve this error, follow these steps:- Install an SSL certificate using Let's Encrypt or any other provider on your local development environment.
- Configure your Laravel app with the correct .env file settings for secure connections. Ensure the
APP_URLis set to HTTPS and not HTTP. - Review the Socialite package code and ensure that it is using https protocol in the callback URLs for Facebook login. You can check the callback URLs by looking at the SocialController methods: "redirect" and "Callback".
- If your local development environment is using http instead of https, modify your server configuration to force SSL or explicitly configure your Laravel application with a VPS service like DigitalOcean or Heroku that offers free SSL certificates.
