【发布时间】:2019-01-24 07:59:50
【问题描述】:
我们使用基于本指南实施的 Discourse SSO 流程:https://meta.discourse.org/t/official-single-sign-on-for-discourse-sso/13045
它对我们来说效果很好。但是现在我们希望允许我们系统中的用户更改他们的电子邮件,这似乎会导致问题。
当我在我们的系统中更改我的用户的电子邮件时,SSO 到 Discourse 停止工作。
登录错误
您的帐户有问题。请联系网站的 管理员。
我猜 Discourse 收到了一个有效负载,其中包含不匹配的电子邮件和用户名,并且不知道该怎么做。
有什么好的方法来处理这个问题?
我想出的最佳想法是在启动 SSO 之前使用 Discourse API 更改用户在 Discourse 中的电子邮件以匹配系统中的电子邮件。
但我不知道这是否可能。以下是我失败的尝试。
这是我的要求:
https://forum-stage.{domain}.com/users/{username}/preferences/email
Headers:
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Body (as x-www-form-urlencoded in Postman):
email: testemail@testdomain.com
api_key: 75a...77d
api_username: system
这是我收到的回复
{
"errors": [
"You are not permitted to view the requested resource."
],
"error_type": "invalid_access"
}
【问题讨论】:
标签: discourse