JSSDK Unknown Host domain

Viewed 19256

With the new Facebook changes on August 1, 2021 (I think) the Developer Dashboard > Facebook Login settings have been updated and now include a Allowed Domains for the JavaScript SDK section.

The Problem

I cannot add a port number to the domain like I can in the Valid OAuth Redirect URIs section. After clicking Save Changes the port numbers are removed from the entries. Our app is currently in development, and while serving the app from https://www.example.localhost:4200 we are given the error while using the Facebook JavaScript SDK:

JSSDK Unknown Host domain: The Domain you are hosting the Facebook Javascript SDK is not in your app's Javascript SDK host domain list. Please specify your host domain in App dashboard login settings.

Facebook Error Image

3 Answers

The same problem, but I used the field "Authorized domains for the JavaScript SDK" with the URL and port and it works.

Here with your URL: FB App

(I used Chrome english translation, sorry if the fields doesn't have the same words ;) )

Started to have the same issue today.

The workaround that helped me is to use port 443 (default for HTTPS), in this case the origin has no port indicated in the URI and it passes "Allowed Domains for the JavaScript SDK" check.

As ii see you are using https on local, a few hours ago I am doing the same then I shift my project to normal http and not on https, but due to this facebook doesn't send the sensitive data and give if you see in setting then there is enforce https and its toggle option is disable in that case you can create your facebook login API app test version

enter image description here

after that I am able to use it on my project as it on localhost:3000.

Related