# Configure Facebook login for Discourse

**URL:** https://meta.discourse.org/t/configure-facebook-login-for-discourse/13394
**Category:** Integrations
**Tags:** sso, how-to, social-auth
**Created:** [March 4, 2014, 5:40pm UTC](https://meta.discourse.org/t/configure-facebook-login-for-discourse/13394 "2014-03-04T17:40:19Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [March 4, 2014, 5:40pm UTC](https://meta.discourse.org/t/configure-facebook-login-for-discourse/13394/1 "2014-03-04T17:40:19Z")

</div>

❗ **As of February 2023, Meta has implemented a business verification requirement when publishing new and existing apps.**

> ⚠ Updating the Facebook app API or creating a new app will break existing logins. See troubleshooting at the bottom of this post for a solution.

### Configuration

Go to [developers.facebook.com/apps](https://developers.facebook.com/apps) and …

1. Login with the credentials of the account you want to connect to Discourse and follow the wizard.  
If you already have other apps instead of `Get Started` you will see the entry `My Apps`, then just click on ➕ `Add new app` and follow the guide from step 1b

 ![image](https://global.discourse-cdn.com/meta/original/4X/f/5/e/f5e6494265fecb4d7c9d54ee2ca1fc5a1c646754.png)

```
1a. Select Developer
 ![image|690x408,50%](upload://aps07RfPhmhHIHyMqO3RZkbnKaX.png) 
1b. Provide a name for the app, for example `Discourse Login` and click on <kbd>Next</kbd>.
 ![image|690x435,50%](upload://bqzuaZ5sdnGEdaWWtUqvv9zO6qU.png) 
1c. Click on <kbd>Add your first product</kbd>
 ![image|690x352](upload://8VWUUU5YYXsCVOC2GrhJb3bJbmj.png)

```

1. Click Set Up below Facebook Login.  

2. From the menu on the left, exit Quickstart by clicking on Settings under `Facebook Login`  

3. Setup the `Valid OAuth redirect URI` field, entering `https://discourse.example.com/auth/facebook/callback` – obviously, replacing the domain with your site’s actual domain name and matching the HTTPS protocol. Remember that the HTTPS protocol is now mandatory for all URI redirects. Click Save Changes.  
Once completed, a successful setup should look like this in **Products/Facebook Login/Settings** :  

4. Navigate to **Settings/Basic** , enter your Discourse URL (`https://discourse.example.com`) in the `App Domains` field and also enter the URL for your Discourse site privacy policy and Terms of Service in the appropriate fields and also upload the icon of your site. (Mind that for your privacy and tos link to be verified, you should have a valid SSL certificate integrates, which is not self-signed. If the certificate is missing, or self-signed, you won’t be able to save your changes).  
If you have a company that does business in the European Union, you may want to fill in the `Data Protection Officer Contact Information` form before clicking on Save Changes.

5. At the bottom of the page click on ➕ `Add Platform` and select `Website`  

6. Enter your Discourse URL here, for example `https://discourse.example.com` and click Save Changes  

7. Click on the Status button to change your app from `in development` to `public`.  

8. In Discourse site settings, enter your Facebook app’s App ID and App Secret in the `facebook app id` and `facebook app secret` fields. You’ll also want to check off `Enable Facebook authentication, requires facebook_app_id and facebook_app_secret`

That’s it! Facebook login should work now. Be sure to test it from a “normal” Facebook account, not your developer account.

### Troubleshooting

#### Hosted Customers

> :discourse2: If you are a Discourse hosting customer, contact us via the email address on your site dashboard and we will be happy to assist. 👍 🙂

If you’re hosted by another provider you will need to contact them for any server-related tasks or issues.

#### Self-hosters

If the Facebook app API is updated, or the app ID/secret are changed, you’ll need to remove existing associations from your site before users can log in again. To remove this data, run the following:

```plaintext
cd /var/discourse
./launcher enter app
rails c
UserAssociatedAccount.where(provider_name: "facebook").delete_all

```

> Last edited by @martin 2024-06-11T07:00:30Z
> 
> > **Check document**
> >
> > Perform check on document:

---

_[View the full topic](https://meta.discourse.org/t/configure-facebook-login-for-discourse/13394)._
