Skip to content

Instantly share code, notes, and snippets.

@travisvalentine
Last active November 6, 2026 07:06
Show Gist options
  • Select an option

  • Save travisvalentine/8796187 to your computer and use it in GitHub Desktop.

Select an option

Save travisvalentine/8796187 to your computer and use it in GitHub Desktop.
Setup Facebook app 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.
@nicky-lenaers

Copy link
Copy Markdown

Very curious about a solution here! Enforcement of HTTPS makes it hard to work with locally :(

@kamel-romdhani

Copy link
Copy Markdown

thank you for sharing this

@Miguel-Lara

Copy link
Copy Markdown

Thank you! You saved me.

@VA-ibh-AV

Copy link
Copy Markdown

so do we need to convert our localhost into https?

@kire73

kire73 commented Aug 30, 2019 •

Copy link
Copy Markdown

This solution worked for me. Trying to add localhost as a "Website" (Platform) in the app settings was being rejected because it didn't match my production domains, which I didn't want to remove.

Even though the message was saying it needed to be among my app domains, it turned out that in

Products -> Facebook Login -> Settings

with Strict Mode enabled, simply adding https://localhost:8000/auth/facebook/callback to the Valid OAuth Redirect URIs allowed me to test the authentication with ssl, locally.

I should probably also note that localhost was already in my "App Domains" in the basic settings (while "https://" and port were being removed when I tried to enter them)

@Ashish-gh23

Copy link
Copy Markdown

Hi I am still stuck with this issue, Can anyone please help me with this
I have added https://localhost:3000/auth/facebook/secrets to valid OAuth REdirect URIs and undeer app domain i have added link of my localhost http://localhost:3000/auth/facebook/secrets..
But still I am getting error as

This site can’t provide a secure connectionlocalhost sent an invalid response.
Try running Windows Network Diagnostics.
ERR_SSL_PROTOCOL_ERROR

@lakhbawa

Copy link
Copy Markdown

Thank you man

@imtechieraj

Copy link
Copy Markdown

This solution worked for me. Trying to add localhost as a "Website" (Platform) in the app settings was being rejected because it didn't match my production domains, which I didn't want to remove.

Even though the message was saying it needed to be among my app domains, it turned out that in

Products -> Facebook Login -> Settings

with Strict Mode enabled, simply adding https://localhost:8000/auth/facebook/callback to the Valid OAuth Redirect URIs allowed me to test the authentication with ssl, locally.

I should probably also note that localhost was already in my "App Domains" in the basic settings (while "https://" and port were being removed when I tried to enter them)

You Save my life <3

@KES777

KES777 commented May 15, 2025 •

Copy link
Copy Markdown

It does not work.
image

Also I have this one:
image

but when I navigate from http://localhost it says that
image

🤐

@Anindya007

Copy link
Copy Markdown

Thanks, I was looking for a solution to this pesky problem for quite a few hours and glad I could find yours.

@KES777

KES777 commented Oct 25, 2025

Copy link
Copy Markdown

@Anindya007 yeah, I spent around 2 days to get it setup correctly, but with others I spent less than an hour.

@aspire-png

Copy link
Copy Markdown

A useful point here is that local Facebook authentication issues often come down to matching the exact redirect URI and domain settings rather than changing the application code. The same principle applies when choosing between B2B and B2C travel systems, since the right setup depends on who owns the customer relationship and booking flow. TravelBookingPanel explores that distinction in a practical way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment