Facebook OAuth SSO Setup

Last updated on
25 February 2026

This document will help you configure Facebook as an OAuth provider making Drupal as an OAuth Client. Following these steps will allow you to configure OAuth / OpenID Single Sign-On (SSO) between Facebook and your Drupal site such that your users will be able to login to your Drupal site using their Facebook credentials. 

We provide Drupal OAuth & OpenID Connect Login - OAuth2 Client SSO Login module which is compatible with Drupal 7, Drupal 8, Drupal 9, Drupal 10, and Drupal 11.

Download  Know more

Prerequisite:

Steps to configure Drupal as OAuth Client:

  • After installing the module, go to the Configuration tab and click on the miniOrange OAuth Client. (/admin/config/people/mo-oauth-client/mo-client-config)

    Configuration-Drupal-Click-on-the-miniOrange-OAuth-Client-Configuration

  • In the Manage section, under the Client Configuration tab, click on the + Add New button to configure the desired OAuth Client.

    Drupal OAuth client click on Add new

  • Provide the following information in the Client Configuration -> Add tab:
    • Choose Facebook from the Select Application dropdown.
    • Enter the Custom App Name of your choice. For example, Facebook.
    • Copy the Callback/Redirect URL and keep it handy.In the Configure OAuth tab, provide the following information

Configure OAuth SSO Application in Facebook (Meta):

  • To build a new OAuth application, click the Create App button in the All Apps section.

    All-Apps-Meta-for-Developers-Click-on-Create-App

  • Select "What do you want your app to do?" on the Create an App section. Then click the Next button to continue.

    Create-an-app-Meta-for-Developers-Select-option-as-per-your-choice

  • In the following screen, choose 'What do you need your app to do?' from the Select an app type section and click the Next button. (After your app is built, the app type cannot be changed.)

    Meta-for-Developers-Select-an-app-type-then-click-on-Next-button

  • In the Details section, enter the Application name in the Add an app name text field and the App contact email (the default is your Facebook account email), then click the Create app button.

    App-creation-Meta-for-Developers-enter-application-in-the-details-section

  • When you click the Create app button, a dialogue window will appear. For your security, you must re-enter your password to continue.

    Meta-for-Developers-for-security-check-enter-your-password

  • In the Add product to your app screen, click on the Set up button from the Facebook Login card.

    Add-Product-Meta-for-Developers-Click-on-Set-up-from-Facebook-Login

  • Navigate to Products from the left navigation panel, then Facebook Login and Settings.

    Facebook-Login-Meta-for-Developers-Navigate-to-Settings

  • Under the Client OAuth Settings, paste the previously copied Callback/Redirect URL into the Valid OAuth Redirect URIs text field.

    Facebook-Login-Meta-for-Developers-Paste-the-Callback-URL-into-the-Valid-OAuth-Redirect-field

  • Click on Save changes button to proceed.
  • Navigate to Settings on the left and select Basic.

    Facebook-Login-Meta-for-Developers-Navigate-Settings-and-click-on-Basic

Integrating Drupal with Facebook:

  • Go to Facebook's developer console.
  • Copy the App ID (this is your Client ID) from the Basic section and keep it ready.

    Application-name-Settings-Meta-for-Developers-Copy-App-ID

  • In Drupal's Configure OAuth tab paste the copied App ID into Client ID text field.

    Configure-OAuth-tab-Drupal-Paste-the-App-ID-into-Client-ID-field

  • Navigate to the Facebook interface and click the Show button on the left side Basic tab.

    Meta-for-Developers-click-on-Show-button-from-basic-section

  • Then, copy the App secret (your Client Secret).

    Settings-Meta-for-Developers-Copy-client-secret

  • In Drupal's Configure OAuth tab paste the copied App secret into the Client Secret text field.

    Drupal-OAuth-Client-paste-copied-Client-Secret

  • After that, check the Scope and Endpoints, and then click on the Save Configuration button.

  • The Send Client ID and Secret in radio button allows you to specify whether the Client ID and Secret should be included in the header or the body of the Token Endpoint Request. If you're unsure which option to select, you can stick with the default settings.

    Configure-OAuth-Drupal-verify-Endpoints

You can also refer to the Facebook Endpoints and scope from the table given below:

Authorization Endpoint https://www.facebook.com/dialog/oauth
Access Token Endpoint https://graph.facebook.com/v2.8/oauth/access_token
Get User Info Endpoint https://graph.facebook.com/me/?fields=id,name,email,age_range,first_name,gender,last_name,link
Scope email

Test Configuration of Drupal with Facebook:

  • After successfully saving the configurations, click on the Perform Test Configuration button to check the OAuth SSO connection between Drupal and Facebook (Meta).

    Drupal-Click-on-Perform-Test-Configuration-button

  • On a Test Configuration popup, if you don't have any active session in Facebook on the same browser, you will be asked to login to your Facebook account. Once you are successfully logged into the Facebook account, you will be provided with a list of the attributes that are received from Facebook. 
  • Scroll to the bottom and click on the Configure Mappings button.

    On-the-Test-Configuration-window-get-attribute-from-facebook-meta

  • Once you click on the Configure Mapping button, you will be redirected to the Attribute Mapping tab. From there, select the appropriate attribute from the OAuth Server Attribute dropdown where the email value is received, and then click the Save Configuration button.

    Drupal-Select-Username-Attribute-from-Attribute-and-Role-Mapping-tab

Please Note: Mapping the Email Attribute is mandatory for your login to work. 

Congratulations! You have successfully configured Facebook as an OAuth Provider and Drupal as an OAuth Client.

How to perform the SSO login?

  • Now, open a new browser/private window and go to your Drupal site login page.
  • Click on the Login using Facebook link to initiate the SSO from Drupal.
  • If the configuration is correct, you will be logged in to the Drupal site.

Contact our 24*7 support team

Feel free to reach out to our Drupal experts if you need any sort of assistance in setting up OAuth Client SSO Login on your Drupal site.

 Get In Touch With Us Join Our Slack Channel

back to top Back to top