This project is part of the Drupal Social Initiative and is based on the Social API.
Social Auth Facebook allows users to register and login to your Drupal site with their Facebook account. The module allows websites to request any scopes, so any tasks requiring authentication with Facebook services can be performed. This module is based on Social Auth and Social API projects
This module adds a path user/login/facebook
which redirects the user to Facebook for authentication.
After Facebook has returned the user to your site, the module compares the user id or email address provided by Facebook. If the user has previously registered using Facebook or your site already has an account with the same email address, the user is logged in. If not, a new user account is created. Also, a Facebook account can be associated with an authenticated user.
Login process can be initiated from the "Facebook" button in the Social Auth block. Alternatively, site builders can place (and theme) a link to user/login/facebook
wherever on the site.
Configuration
In Drupal
-
Log in as an admin.
-
Navigate to Configuration » User authentication » Facebook and copy the Authorized redirect URL field value (the URL should end in
/user/login/facebook/callback
).
In Meta for Developers:
-
Log in to a Facebook account.
-
Navigate to My Apps.
-
Click Create app.
-
Enter a Display name for the app and click Create app.
-
From the app landing page under Add products to your app > Facebook Login click Set up.
-
Under Products > Facebook Login click Settings (do not use "Quickstart").
-
Paste the URL copied from Step 2 in the Valid OAuth Redirect URIs field.
-
Navigate to Settings > Basic.
-
Copy and save the App ID value somewhere safe.
-
Click Show for the App secret field. Copy and App secret value and save it somewhere safe.
-
Navigate to Settings > Advanced.
-
Under Upgrade API version note the API version in use (e.g., "14.0").
In Drupal:
-
Return to Configuration » User authentication » Facebook
-
Enter the Facebook app ID in the App ID field.
-
Enter the Facebook app secret in the App secret field.
-
Enter the API version in the Facebook Graph API version field.
-
Click Save configuration.
-
Navigate to Structure » Block Layout and place a Social Auth login block somewhere on the site (if not already placed).
That's it! Test the connection by logging in with your own account. For further testing navigate to Roles > Test Users to create and add other testers.
When ready log in to Meta for Developers, navigate to OAuth app, and change the App Mode to "Live" to allow any user with a Facebook account to log in.
Project information
- Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed. - Maintenance fixes only
Considered feature-complete by its maintainers. - Module categories: Access Control
- Ecosystem: Social Auth, Social API
- 2,046 sites report using this module
- Created by gvso on , updated
- Drupal 10 is here!
Version 3.0.1 and all 4.x versions support Drupal 10.
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.