使用非唯一邮箱地址的SSO?

Is it possible to use Discourse with SSO and email addresses which are not unique?
That means users have multiple accounts with different usernames but same email addresses.

No, emails are unique identifiers for users in Discourse and this is fundamental to all identity in the system.

A work around for many people is to use +addressing, like user+joe@gmail.com, user+pat@gmail.com, and so on. O all email providers support that, but most do.

@pfaffman how exactly is that going to help them there? By disambiguating? That is true, when you have

user@example.com

you could change it to

user+secondary@example.com1

It’s often useful to have multiple accounts, and using +addressing lets you do that without creating multiple email
Addresses.

User+whatever@gmail.com will get delivered to user@gmail.com. User@gmail.com1 won’t let them create an account.

Oh, but SSO was the point of this thread, so it’s not clear that my solution will help here. They’d still need to make every email address unique, one way or another.

我来晚了,但如果你们使用的是自己的 SSO 系统(例如不是 Google/GitHub 等),那么我的计划是使用用户的邮箱,并在 @ 之前插入 +username。如果这对大家有帮助,这就是我们目前的方案。

不过,这又该如何与单点登录(SSO)配合使用呢?

我们实现了自己的 Discourse SSO 提供者——因此,该系统可以适配为向 Discourse 发送唯一的电子邮件地址(例如,将 user@gmail.com 替换为 user+internal_id@gmail.com)。当用户登录时,他们不会看到任何相关内容,因为他们使用用户名登录我们的 SSO 系统。

最终,这并不是完美的解决方案,因为它无法为所有用户发送电子邮件,但它确实可以避免在电子邮件不唯一的系统中出现真实的邮件冲突。(遗憾的是,我正在使用的特定应用程序对用户名的限制比 Discourse 更少,因此可能会出现冲突,不过目前来看可能性非常低。)

我认为,长期的最佳解决方案可能是开发一个插件,用于存储单独的_通知_电子邮件地址,并让 SSO 传递一个唯一的(甚至可能是伪造的?)电子邮件地址,以及一个无需唯一的用于通知的电子邮件地址。我尚不确定这是否会严重破坏系统功能,但粗略浏览代码约 30 分钟后,我认为这是一个可行但可能较为繁琐的解决方案。