Skip to content
Geremia Taglialatela edited this page Feb 6, 2021 · 25 revisions

FACEBOOK HAS BEEN REMOVED IN FAVOR OF AUTH0. THIS WIKI IS PRESERVED FOR HISTORICAL REASONS

Prerequisites

You need a verified Facebook account.

Create a new Facebook application

  1. Login to https://developers.facebook.com/
  2. Click on My Apps -> Add a New App -> For Everything Else
  3. Fill in Display Name with your app's name (eg: My Icare) and click on Create App ID
  4. Click on Settings on the left sidebar
  5. Set a Namespace (eg: myicare)
  6. Fill in App Domains with your application's domain (eg: myicare.herokuapp.com)
  7. Click on Add Platform
  8. Click on Website
  9. Fill in Site URL with your application's URL (eg: https://myicare.herokuapp.com) and press Save changes
  10. Click on Save Changes, we are done!

Configure Facebook Login OAuth

When you attempt logging into your app for the first time, you will get an error:

Can't Load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and subdomains of your app to the App Domains field in your app settings.

This will automatically add Facebook Login as a product in your Facebook developer console.

You will need to add the following Valid OAuth Redirect URIs under Products > Facebook Login > Settings:
https://<app name>.herokuapp.com/users/auth/facebook/callback | https://<app name>.herokuapp.com/

For example:
https://myicare.herokuapp.com/users/auth/facebook/callback | https://myicare.herokuapp.com/

Local Development

We suggest you to create a separate application for the development environment.

Fill in App Domains with lvh.me and Site URL with http://lvh.me:3000/. If you are not able to connect to http://lvh.me:3000/, try to start your application via rails s -b 0.0.0.0.

Note that lvh.me is a free online service that redirects all requests (including subdomains) to localhost