# DiscourseConnect、SSO 和电子邮件地址确认

**URL:** https://meta.discourse.org/t/discourseconnect-sso-and-e-mail-address-confirmation/198657
**Category:** SSO
**Tags:** discourseconnect
**Created:** [2021年七月30日 08:45 UTC](https://meta.discourse.org/t/discourseconnect-sso-and-e-mail-address-confirmation/198657 "2021-07-30T08:45:33Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![lubezniy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lubezniy/32/137694_2.png) [@lubezniy](https://meta.discourse.org/u/lubezniy)
#### Post date: [2021年七月30日 08:45 UTC](https://meta.discourse.org/t/discourseconnect-sso-and-e-mail-address-confirmation/198657/1 "2021-07-30T08:45:33Z")

</div>

你好。

我们在使用 Discourse 并通过我们网站的 SSO 进行身份验证。用户通过我们的身份验证后，进入 Discourse 网站并点击“登录”；我们的服务器会发送一个包含 SSO 数据的请求以获取重定向 URL。现在我们需要一项任务：当用户在网站个人资料中更改某些用户属性时，同步更新 Discourse 个人资料中的相应属性。我们曾使用 Discourse API 的“[更新邮箱](https://docs.discourse.org/#tag/Users/paths/~1u~1%7Busername%7D~1preferences~1email.json/put)”方法来更新电子邮件地址，但当用户更改邮箱时，新地址会以未确认状态添加到 Discourse 个人资料中。当我尝试发送确认邮件时，邮件会发送到旧的、已确认的地址，而邮件中的确认链接无法使用。我能否采取某些措施在不进行确认的情况下更新邮箱地址？我们无需通过 Discourse 进行邮箱确认，因为我们的身份验证系统已经完成了这一验证。还有一个情况：旧邮箱可能已经无法访问，这使得用户无法通过邮箱进行更改。

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2021年七月30日 08:50 UTC](https://meta.discourse.org/t/discourseconnect-sso-and-e-mail-address-confirmation/198657/2 "2021-07-30T08:50:59Z")

</div>

对于该操作，请使用 `sync_sso` 路由，详见 [https://meta.discourse.org/t/sync-discourseconnect-user-data-with-the-sync-sso-route/84398。此外，请确保在“管理](https://meta.discourse.org/t/sync-discourseconnect-user-data-with-the-sync-sso-route/84398%E3%80%82%E6%AD%A4%E5%A4%96%EF%BC%8C%E8%AF%B7%E7%A1%AE%E4%BF%9D%E5%9C%A8%E2%80%9C%E7%AE%A1%E7%90%86) - 设置 - 登录”中启用 `auth overrides email`。

---

<div class="post-metadata">

### Author: ![lubezniy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lubezniy/32/137694_2.png) [@lubezniy](https://meta.discourse.org/u/lubezniy)
#### Post date: [2021年七月30日 09:27 UTC](https://meta.discourse.org/t/discourseconnect-sso-and-e-mail-address-confirmation/198657/3 "2021-07-30T09:27:59Z")

</div>

非常感谢。描述显示这正是我们所需要的。我将尝试使用它。

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2021年八月29日 09:29 UTC](https://meta.discourse.org/t/discourseconnect-sso-and-e-mail-address-confirmation/198657/4 "2021-08-29T09:29:00Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
