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 Authorized 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.
Before you start
- You need to create a Clerk Application in your Clerk Dashboard. For more information, check out our Set up your application guide.
- You need to have a Facebook Developer account. To create one, consult the Register as a Facebook developer page.
Configuring Facebook social connection
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.
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.
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.
Before you close the modal, copy the Authorized 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
Last updated on