Updating the Facebook app API or creating a new app will break existing logins. See troubleshooting below for a solution.
Go to developers.facebook.com/apps and …
“Create or Add a New App”.
Provide a name for the app, for example “Discourse Login”.
Click “Create App ID”.
Click “Set Up” below Facebook Login.
From the menu on the left, exit Quickstart by clicking on Settings
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 correct protocol,
https. Click Save Changes.
Once completed, a successful setup should look like this in Products / Facebook Login / Settings:
Navigate to Settings/Basic:
Enter your Discourse URL (
https://discourse.example.com) in the “App Domains” field (mandatory from March 2018).
At the bottom of the page click on “ Add Platform” and select Website
Enter your Discourse URL here, for example
https://discourse.example.comand click Save Changes
Click on the Status button to change your app from “in development” to “public”.
The category you select does not matter.
After a few seconds the button will become:
In Discourse site settings, enter your Facebook app’s App ID and App Secret in the
facebook app idand
facebook app secretfields. 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.
If the Facebook app API is updated, or the app ID/secret are change, you’ll need to remove existing
FacebookUserInfo from your site before users can log in again. To remove this data, run the following:
cd /var/discourse ./launcher enter app rails c FacebookUserInfo.delete_all
If you are a Discourse hosting customer, contact @team and we can assist.