# Facebook 登录无法使用 2020

**URL:** https://meta.discourse.org/t/facebook-login-not-working-2020/150649
**Category:** Support
**Created:** [2020年五月6日 20:04 UTC](https://meta.discourse.org/t/facebook-login-not-working-2020/150649 "2020-05-06T20:04:16Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Alex\_K1](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@Alex\_K1](https://meta.discourse.org/u/Alex_K1)
#### Post date: [2020年五月6日 20:04 UTC](https://meta.discourse.org/t/facebook-login-not-working-2020/150649/1 "2020-05-06T20:04:16Z")

</div>

它给出的错误如下：

`无法加载 URL：此 URL 的域名未包含在应用的域名中。要能够加载此 URL，请将应用的所有域名和子域名添加到应用设置中的“应用域名”字段`

应用域名已在站点设置中配置。它不是子域名，且站点使用 https。我甚至还在设置中添加了 www 以防万一。

查看后发现，在“产品”下的 Facebook 登录设置中，不仅“强制使用 https”已开启，还有以下设置：

`对重定向 URI 使用严格模式：仅允许使用 Facebook SDK 或完全匹配有效 OAuth 重定向 URI 的重定向。强烈建议。`

根据我在其他地方看到的解决方法，此设置无法关闭。在那里添加域名会报错，提示重定向 URI 未列入白名单且不匹配。

那么，Discourse 在创建账户和登录账户时的重定向 URI 应该是什么呢？

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2020年五月6日 20:33 UTC](https://meta.discourse.org/t/facebook-login-not-working-2020/150649/2 "2020-05-06T20:33:18Z")

</div>

您在 Facebook 登录设置中设置的精确重定向 URI 是什么？

---

<div class="post-metadata">

### Author: ![Alex\_K1](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@Alex\_K1](https://meta.discourse.org/u/Alex_K1)
#### Post date: [2020年五月6日 20:36 UTC](https://meta.discourse.org/t/facebook-login-not-working-2020/150649/3 "2020-05-06T20:36:33Z")

</div>

根据我在这里找到的说明，我没有看到任何关于客户端 OAuth 设置的示例。目前，我将其设置为 `https://examplesite.com/`，以查看它是否有效或抛出错误。我在此处创建了一个账户，试图捕获完整的重定向 URL，但未能成功。我不确定为了实现登录和创建账户功能，该 URL 需要设置为什么。

---

<div class="post-metadata">

### Author: ![Alex\_K1](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@Alex\_K1](https://meta.discourse.org/u/Alex_K1)
#### Post date: [2020年五月6日 20:43 UTC](https://meta.discourse.org/t/facebook-login-not-working-2020/150649/4 "2020-05-06T20:43:21Z")

</div>

没有关闭该设置的选项。

 ![facebook](https://global.discourse-cdn.com/meta/original/3X/e/d/edd8b061d5da7e7f66d0d717816097d98e312254.png)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2020年五月6日 20:45 UTC](https://meta.discourse.org/t/facebook-login-not-working-2020/150649/5 "2020-05-06T20:45:36Z")

</div>

> [@Alex\_K1](#):
>
> 根据我在这里找到的说明，我没有看到任何关于客户端 OAuth 设置的示例

呃，什么？说明已经很清楚了

> 设置 `Valid OAuth redirect URI` 字段，输入 `https://discourse.example.com/auth/facebook/callback`——显然，需要将域名替换为您网站的实际域名，并匹配 HTTPS 协议。

---

<div class="post-metadata">

### Author: ![Alex\_K1](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@Alex\_K1](https://meta.discourse.org/u/Alex_K1)
#### Post date: [2020年五月6日 20:47 UTC](https://meta.discourse.org/t/facebook-login-not-working-2020/150649/6 "2020-05-06T20:47:15Z")

</div>

嗯，其实我是从页面上复制粘贴的。但没意识到它在设置中的位置。我确实看到了，但似乎没保存。我现在再试一次。谢谢

---

<div class="post-metadata">

### Author: ![Alex\_K1](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@Alex\_K1](https://meta.discourse.org/u/Alex_K1)
#### Post date: [2020年五月6日 20:49 UTC](https://meta.discourse.org/t/facebook-login-not-working-2020/150649/7 "2020-05-06T20:49:46Z")

</div>

> [@codinghorror](#):
>
> [https://discourse.example.com/auth/facebook/callback](https://discourse.example.com/auth/facebook/callback)

运行完美。我想是我没有保存。谢谢。

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [2020年五月6日 21:23 UTC](https://meta.discourse.org/t/facebook-login-not-working-2020/150649/8 "2020-05-06T21:23:53Z")

</div>


