Skip to content

Instantly share code, notes, and snippets.

@tiagobbraga
Forked from travisvalentine/steps.md
Last active May 12, 2021 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiagobbraga/71a5c094a5afdcceb836a63d99a6be06 to your computer and use it in GitHub Desktop.
Save tiagobbraga/71a5c094a5afdcceb836a63d99a6be06 to your computer and use it in GitHub Desktop.
Setup Facebook app with firebase authentication to test authentication locally (aka, setting up App Domain)

Note: I had issues with setting up my Facebook app so authentication would work. I'd receive the error at the bottom, and it took me a while to figure out what was wrong

Here are the steps I took:

  • Go to http://developers.facebook.com/, create, and setup your app
  • When inside the dashboard, click "Settings"
  • Click "Add Platform"
  • Choose website (for authentication via the web app)
  • Add http://localhost:3000/ as "Site URL" (and "Mobile URL" if necessary)
  • Add localhost to "App Domains" above
  • Click Save

This fixed the error I kept receiving:

Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.

More one thing - Firebase console:

  • Go to https://console.firebase.google.com and click in your app
  • Click "Authentication" > "Sign-in Method" > "Facebook"
  • Copy the link "OAuth redirect"
  • Go to https://developers.facebook.com and click in your app
  • Click "Facebook Login" > "Settings"
  • In the field "Valid OAuth Redirect URIs", paste the link copied

This fixed the error I kept receiving:

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment