Docs

Add Facebook as a social connection

How to set up social connection with Facebook

Overview

Adding social connection with Facebook to your app with Clerk is done in a few steps - you only need to set the Client ID, Client Secret and Redirect URI in your instance settings.

To make the development flow as smooth as possible, Clerk uses preconfigured shared OAuth credentials and redirect URIs for development instances - no other configuration is needed.

For production instances, you will need to create your own developer account with Facebook and generate your own App ID and App Secret.

Note

The purpose of this guide is to help you set up a Facebook developer account and a Facebook OAuth2.0 project - if you're looking for step-by-step instructions using Clerk to add Social Connection (OAuth) to your application, follow the Social connection (OAuth) guide.

Before you start

Configuring Facebook social connection

Creating a Facebook app

First, you need to create a new Facebook app and enable Facebook sign-in. Follow the official Facebook instructions on how to create a Facebook app. When asked to choose an app type, make sure you select Consumer. To learn more about Facebook app types, check the Facebook App Types page.

Enabling Facebook sign-in for your app

At the end of the app creation wizard, you will get redirected to the app dashboard. Find the Facebook login card and click Set Up. There's no need to go through the quickstart wizard - open the Settings dropdown menu (sidebar) and click Basic, as shown in the screenshot above.

Once you have a OAuth client ID created, click on the newly created ID under OAuth 2.0 Client IDs and copy the App Id and App Secret.

Retrieving the App ID and App Secret

Navigate to the Clerk Dashboard. In the top navigation, select Configure. Then in the sidebar, select SSO connections. Select the Add connection button, and select For all users. In the Choose provider dropdown, select Facebook. Toggle on Use custom credentials and paste the values you obtained during the previous step.

Adding the valid OAuth Redirect URI

Before you close the modal, copy the Redirect URI. Go back to the Facebook dashboard, open the Facebook Login menu (sidebar) and click Settings. Paste the URI you copied before into the Valid OAuth Redirect URIs field. Hit Save Changes.

Finally, select Add connection so that the settings are applied. Congratulations! Social connection with Facebook is now configured for your instance.

Feedback

What did you think of this content?

Last updated on