Connect your app to Facebook

To connect your Auth0 app to Facebook, you will need an App ID and App Secret from your Facebook app, then copy these keys into your Auth0 settings and enable the connection.

This doc refers to the client steps to connect your client. If you are looking to manage authentication in your application, see Next Steps below.

1. Login to Facebook Developers

Go to Facebook Developers and login with your account. Select Add a New App from the dropdown in the upper right:

Add a New App

2. Name your application

Provide a Display Name and Contact Email.

Create a New App

Next you will need to complete the Security Check.

3. Setup Facebook Login

On the Product Setup page that follows, click Get Started next to Facebook Login:

Click Get Started

Next choose the type of application, for this tutorial we have selected Web.

The Client OAuth Settings page for Facebook Login will appear:

Client OAuth Settings

Enter the following URL in the Valid OAuth redirect URIs field:

https://YOUR_AUTH0_DOMAIN/login/callback

Find your Auth0 domain name

If your Auth0 domain name is not shown above, login to the dashboard to find your Account Name in the top right corner. Your Auth0 domain is this name (for example abc-enterprises) plus .auth0.com. So for this example the Valid OAuth redirect URI would be: https://abc-enterprises.auth0.com/login/callback.

Enter OAuth redirect URI

Click Save Changes.

4. Make your App Public

Next, click on App Review on the left navigation bar. Near the top of the page under Make (Your App Name) App public? click to move the slider to Yes.

Make Public

5. Get your App ID and App Secret

Click Settings in the left nav. On this page you can retrieve your App ID and App Secret.

Settings page

Click Show to reveal the App Secret (you may be required to re-enter your Facebook password).

In a seperate tab or window, go to the Connections > Social section of the Auth0 dashboard.

Click on the box with the Facebook logo.

This will bring up the Facebook connection settings.

Copy the App ID and App Secret from the Settings of your app on Facebook:

Auth0 Facebook Settings

Select all the Attributes and Permissions you want to enable.

Your users will be able to choose which Attributes they wish to share, and by default this selection is only made when they first authorize the application. Click here to learn more about handling declined permissions.

Then click the Clients tab and select the applications you wish to enable this connection for.

Enable clients

When finished click Save.

6. Test the Connection

In the Connections > Social section of the Auth0 dashboard a TRY icon will now be displayed next to the Facebook logo:

Click Try

Click TRY.

The Facebook allow access dialog will appear.

Continue

Click continue and if configured correctly, you will see the It works!!! page:

Additional Info

Create a Test App

Facebook now allows you to test your application by creating a copy of it to use for testing purposes. If you create a test application it will have it's own separate App ID and App Secret. Auth0 only allows one Facebook connection to be configured per account. One option for testing is that create the connection to the test connection and then change the values when you are ready to connect to the production application.

Another option is to create another Auth0 account used for testing purposes. A new account can be created in the Dashboard by clicking on your account name in the top right corner and selecting New Account from the dropdown. See the Setting Up Multiple Environments for more information on multiple environments.

Deauthorize Callback URL

On the Facebook Login Client OAuth Settings page, you can also set a Deauthorize Callback URL to be called when a user deauthorizes your app.

Facebook Docs for Facebook Login

Next Steps

Now that you have a working connection, the next step is to configure your application to use it. You can follow our step-by-step quickstarts or use directly our libraries and API.