<commit_before>---
title: Add Facebook Login to Your App
connection: Facebook
index: 2
image: /media/connections/facebook.png
seo_alias: facebook
description: Learn how to add login functionality to your app with Facebook. You will need to generate keys, copy these into your Auth0 settings, and enable the connection.
toc: true
topics:
  - authentication
  - connections
  - social
  - facebook
contentType: how-to
useCase:
  - add-login
  - customize-connections
  - add-idp
---
# Add Facebook Login to Your App

This guide will show you how to add functionality to your web app that allows your users to log in with Facebook. Along the way, you will also learn how to get an Access Token that will allow you to access the Facebook API.

1. Set up your app in Facebook. To learn how, follow Facebook's [App Development](https://developers.facebook.com/docs/apps) docs. During this process, Facebook will generate an **App ID** and **App Secret** for your application; you can find this in the app's **Basic Settings**.

While setting up your app, make sure you use the following settings:

* When asked to select scenarios, choose **Facebook Login**.
* On the **Facebook Login** > **Settings** page, under **Valid Oauth Redirect URIs**, enter `https://${account.namespace}/login/callback`.
* On the **Facebook Login** > **Settings** page, you can also set a **Deauthorize Callback URL** that will be called when a user deauthorizes your app.

<%= include('../_find-auth0-domain-redirects) %>

::: warning
If your application requests sensitive permissions, it may be [subject to review by Facebook](https://developers.facebook.com/docs/apps/review/). Only the `default` and `email` permissions do not currently require app review. For info on Facebook permissions, see Facebook's [Facebook Login Permissions Reference](https://developers.facebook.com/docs/facebook-login/permissions/).
:::

2. [Set up the Facebook social connection](/connections/guides/set-up-connections-social) in Auth0. Make sure you have the App ID and App Secret generated in Step 1.

3. [Test the connection](/connections/guides/test-connections-social).

::: note
Facebook allows you to create a copy of your application to use for testing purposes. A test application has its own unique **App ID** and **App Secret**. Because Auth0 only allows one Facebook connection to be configured per tenant, you have two options for testing in Auth0:

* While testing, use the testing application's **App ID** and **App Secret** in Auth0's social connection, and then change these values when you are ready to connect to the production application.

* [Create another Auth0 tenant](/connections/guides/create-multiple-tenants) to use for testing purposes and [set up a test environment](/dev-lifecycle/setting-up-env#set-the-environment).
:::

4. Access Facebook's API

<%= include('../_call-api', {
  "idp": "Facebook"
}) %>

5. Optional: Get a [Refresh Token](/tokens/refresh-token/current#get-a-refresh-token) from Facebook to refresh your Access Token once it expires. To ensure your application is secure, pay close attention to the [restrictions on using Refresh Tokens](/tokens/refresh-token/current#restrictions-on-refresh-token-usage).

## Facebook Re-Authentication
<commit_msg>Fix include<commit_after>---
title: Add Facebook Login to Your App
connection: Facebook
index: 2
image: /media/connections/facebook.png
seo_alias: facebook
description: Learn how to add login functionality to your app with Facebook. You will need to generate keys, copy these into your Auth0 settings, and enable the connection.
toc: true
topics:
  - authentication
  - connections
  - social
  - facebook
contentType: how-to
useCase:
  - add-login
  - customize-connections
  - add-idp
---
# Add Facebook Login to Your App

This guide will show you how to add functionality to your web app that allows your users to log in with Facebook. Along the way, you will also learn how to get an Access Token that will allow you to access the Facebook API.

1. Set up your app in Facebook. To learn how, follow Facebook's [App Development](https://developers.facebook.com/docs/apps) docs. During this process, Facebook will generate an **App ID** and **App Secret** for your application; you can find this in the app's **Basic Settings**.

While setting up your app, make sure you use the following settings:

* When asked to select scenarios, choose **Facebook Login**.
* On the **Facebook Login** > **Settings** page, under **Valid Oauth Redirect URIs**, enter `https://${account.namespace}/login/callback`.
* On the **Facebook Login** > **Settings** page, you can also set a **Deauthorize Callback URL** that will be called when a user deauthorizes your app.

<%= include('../_find-auth0-domain-redirects') %>

::: warning
If your application requests sensitive permissions, it may be [subject to review by Facebook](https://developers.facebook.com/docs/apps/review/). Only the `default` and `email` permissions do not currently require app review. For info on Facebook permissions, see Facebook's [Facebook Login Permissions Reference](https://developers.facebook.com/docs/facebook-login/permissions/).
:::

2. [Set up the Facebook social connection](/connections/guides/set-up-connections-social) in Auth0. Make sure you have the App ID and App Secret generated in Step 1.

3. [Test the connection](/connections/guides/test-connections-social).

::: note
Facebook allows you to create a copy of your application to use for testing purposes. A test application has its own unique **App ID** and **App Secret**. Because Auth0 only allows one Facebook connection to be configured per tenant, you have two options for testing in Auth0:

* While testing, use the testing application's **App ID** and **App Secret** in Auth0's social connection, and then change these values when you are ready to connect to the production application.

* [Create another Auth0 tenant](/connections/guides/create-multiple-tenants) to use for testing purposes and [set up a test environment](/dev-lifecycle/setting-up-env#set-the-environment).
:::

4. Access Facebook's API

<%= include('../_call-api', {
  "idp": "Facebook"
}) %>

5. Optional: Get a [Refresh Token](/tokens/refresh-token/current#get-a-refresh-token) from Facebook to refresh your Access Token once it expires. To ensure your application is secure, pay close attention to the [restrictions on using Refresh Tokens](/tokens/refresh-token/current#restrictions-on-refresh-token-usage).

## Facebook Re-Authentication

{'fraction_non_alphanumeric': 0.09817176217544937, 'fraction_numerical': 0.00430173605776617, 'mean_word_length': 4.5451448040885865, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 48, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6705254', 'n_tokens_mistral': 1736, 'n_tokens_neox': 1671, 'n_words': 807}