Products
GG网络技术分享 2025-03-18 16:12 62
I am using wordpress themes on localhost on a mac device. I tried on two different themes the Facebook login feature that they integrate in their settings and on both I get the same 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.
Just to mention that earlier I have written a simple AngularJS project and tested the Facebook Login on localhost and it worked fine. I mentioned local.foo.com as the website on facebook developer when creating new App and I edited the /etc/hosts file on mac and added the entry: 127.0.0.1 local.foo.com to make it work.
Now, when trying it on the wordpress themes, I created a new App on facebook developer, and I mentioned local.foo.com as the website (same as I did when I created the working AngularJs example). I used the new App Id in the theme settings, and when trying to login I got the error mentioned above on 2 different themes. I used the same settings that I used for the working AngularJS App. The following image shows the settings on facebook.
Note that I tried to enable more options and to fill the Valid OAuth Redirect URIs field with entries like http://localhost/lovestory corresponding to what appears when I open the app in browser (for example http://127.0.0.1:8888/lovestory), but facebook does not accept anymore URIs with http, since they require only https.
图片转代码服务由CSDN问答提供
感谢您的意见,我们尽快改进~
功能建议我在mac设备上使用localhost上的wordpress主题。 我尝试了两个不同的主题,他们在他们的设置中集成了Facebook登录功能,并且我得到了同样的错误:无法加载URL:此URL的域未包含在应用程序的域中。 为了能够加载此URL,请将应用的所有域和子域添加到应用设置中的“应用域”字段。</ code> </ p>
前面提到我已写过 简单的AngularJS项目并在localhost上测试了Facebook登录,它运行良好。 在创建新的App时,我提到 local.foo.com </ code>作为facebook开发者的网站,我在mac上编辑了/ etc / hosts文件并添加了条目: 127.0.0.1 local.foo。 com </ code>使它工作。</ p>
现在,在wordpress主题上尝试时,我在facebook开发人员上创建了一个新的应用程序,我提到了 local.foo。 com </ code>作为网站(与我在创建工作AngularJs示例时所做的相同)。 我在主题设置中使用了新的App ID,当我尝试登录时,我在2个不同的主题上得到了上面提到的错误。 我使用了与用于AngularJS App的工作相同的设置。 下图显示了Facebook上的设置。</ p>
请注意,我尝试启用更多选项和 使用 http:// localhost / lovestory 等条目填充 Valid OAuth Redirect URIs </ code>字段 我在浏览器中打开应用程序时出现的内容(例如 http://127.0.0.1:8888/lovestory</ a>),但facebook不再接受带有http的URI,因为它们只需要https。</ p>
</ div>
Lately facebook requires https. Therefore, an SSL certificate has to created locally and used. Here is a process to create it: https://medium.freecodecamp.org/how-to-get-https-working-on-your-local-development-environment-in-5-minutes-7af615770eec
Demand feedback