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

  1. Log in as an admin.

  2. 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:

  1. Log in to a Facebook account.

  2. Navigate to My Apps.

  3. Click Create app.

  4. Enter a Display name for the app and click Create app.

  5. From the app landing page under Add products to your app > Facebook Login click Set up.

  6. Under Products > Facebook Login click Settings (do not use "Quickstart").

  7. Paste the URL copied from Step 2 in the Valid OAuth Redirect URIs field.

  8. Navigate to Settings > Basic.

  9. Copy and save the App ID value somewhere safe.

  10. Click Show for the App secret field. Copy and App secret value and save it somewhere safe.

  11. Navigate to Settings > Advanced.

  12. Under Upgrade API version note the API version in use (e.g., "14.0").

In Drupal:

  1. Return to Configuration » User authentication » Facebook

  2. Enter the Facebook app ID in the App ID field.

  3. Enter the Facebook app secret in the App secret field.

  4. Enter the API version in the Facebook Graph API version field.

  5. Click Save configuration.

  6. 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.

Supporting organizations: 
Ongoing maintenance.
Initial planning and development.
Initial planning and development.

Project information

Releases