Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Facebook Laravel Package

socialiteproviders/facebook

Facebook OAuth provider for Laravel Socialite. Adds Facebook login to the SocialiteProviders manager so you can authenticate users with Socialite's familiar API through a simple event listener and config entry. Works with the current Facebook Graph API and installs via Composer.

Deep Wiki
Context7

SocialiteProviders/facebook adds Facebook OAuth 2.0 support to Laravel’s Socialite package. It lets applications authenticate users through Facebook and retrieve their profile data using the familiar Socialite API, with credentials configured through services.php and the SocialiteProviders event listener.

  • Seamless Laravel Socialite integration
  • Facebook OAuth 2.0 login flow
  • Config-driven client ID, secret, and redirect URI
  • Access to Facebook user profile data
  • Drop-in provider for the SocialiteProviders ecosystem
Frequently asked questions about Facebook
How do I install socialiteproviders/facebook in a Laravel app?
Install it with Composer using composer require socialiteproviders/facebook. Register the SocialiteProviders manager service provider if your app does not auto-discover it, and add the Facebook extend Socialite listener to your EventServiceProvider for the SocialiteWasCalled event. Then add Facebook credentials to config/services.php and use Socialite::driver('facebook') in your controller.
How do I configure Facebook OAuth credentials for Laravel Socialite?
Create a Facebook app in the Meta developer console and copy its client ID and secret. Put FACEBOOK_CLIENT_ID, FACEBOOK_CLIENT_SECRET, and FACEBOOK_REDIRECT_URI in your .env file and reference them from the facebook array in config/services.php. The redirect URI must exactly match the callback URL configured in the Facebook app.
Which Laravel versions does socialiteproviders/facebook support?
This package is a subtree split of the SocialiteProviders/Providers repository, so its PHP, Laravel, and Socialite version constraints track that main repository. Check the composer.json requirements for the exact release you plan to install. For current Laravel releases, use the latest package version and keep Laravel Socialite updated.
What Facebook scopes or permissions can I request with this provider?
You can request Facebook permissions by calling scopes() on the Socialite driver before redirecting, for example Socialite::driver('facebook')->scopes(['email'])->redirect(). The email and public_profile permissions are commonly used, while additional permissions usually require Facebook app review. Request only the permissions your application actually needs.
How do I retrieve the authenticated Facebook user's profile data?
In your callback handler, call Socialite::driver('facebook')->user() to receive a Socialite user object. You can then use methods such as getId(), getName(), getEmail(), getAvatar(), and getRaw() to read the Facebook profile data. Store the provider ID and any other required fields in your users table.
Why is the Facebook user's email null after login?
Facebook may not return an email address if the user did not grant the email permission, if the account has no confirmed email, or if the account relies on a phone number. Make sure you request the email scope and handle null emails gracefully in your registration flow. Do not assume every Facebook login will provide an email address.
How should I handle Facebook OAuth callbacks securely in production?
Use HTTPS for your callback URL and make sure it exactly matches the URI registered in the Facebook app. Socialite validates the OAuth state parameter through the session, so use a persistent session driver and avoid stateless mode unless you have a specific reason. Also verify your app domain and valid OAuth redirect URIs in the Meta developer console.
Can I test Facebook login without calling the real Facebook API?
Yes. In feature tests you can mock Socialite::driver('facebook') so it returns a fake provider whose user() method returns a Socialite user instance. This lets you test your callback controller, user creation, and error handling without external HTTP requests. Keep a small number of manual sandbox tests to verify your real Facebook app configuration.
What is the difference between this package and Laravel Socialite's built-in Facebook driver?
Laravel Socialite includes its own Facebook driver, while this package is part of the SocialiteProviders ecosystem and is loaded through the SocialiteProviders manager and SocialiteWasCalled event. Use it if you standardize on SocialiteProviders packages or need this provider's specific implementation. Both approaches handle the redirect, callback, token exchange, and user profile retrieval.
Is socialiteproviders/facebook maintained and safe for production use?
It is a subtree split of the SocialiteProviders/Providers repository and is maintained within that community project. Before production use, check Packagist release activity, review the repository issues, and pin a tested version in composer.lock. Also monitor security advisories and keep Laravel Socialite and the provider package updated.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment