user1012181
user1012181

Reputation: 8726

How to do a connect request for the Facebook App in localhost

I'm creating a login with facebook authentication for my application which is currently in locahost. I created an app in facebook.

Now when I try to access this URL: https://www.facebook.com/dialog/oauth?client_id=my_app_id&redirect_uri=http://localhost:8080/

I'm getting this error:

Given URL is not permitted 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.

Then I tried to add the localhostto my app settings App Domains and I'm getting another error there and cannot save it:

This must be derived from Secure Canvas URL, Unity Binary URL, Site URL, Mobile Site URL or Secure Page Tab URL. Check and correct the following domains: localhost

Am I doing it wrong? or what is the right way to do it for the localhost?

Upvotes: 0

Views: 378

Answers (1)

C3roe
C3roe

Reputation: 96412

You need to add a “Platform” first in app settings.

Add platform “Website”, and input http://localhost/ as Site URL. Only after that will you be able to call the login dialog from your localhost website.

Upvotes: 1

Related Questions