Multiple sites with the same user accounts?

Hi… I’ve searched / browsed this forum but couldn’t find a simple explanation. Is multisite a feature where you want multiple separate sites but on the same server?

What I’m really looking for / wondering is if you can set up multiple forums on the same server, that share the same user database? Sorry if this has already been asked.

To share the userbase, simply have one of the forums be the sso provider and have the other forums be an sso consumer.

5 个赞

Note that this is visible to the user: When they want to log in, they always go to the same site. This could be confusing, depending on the use case. If you want to avoid that, you need to set up an external SSO provider.

Also note that this will share the credentials, but not the user profiles, group memberships, …

Profile stuff can be handled in the payload.

Related:

https://meta.discourse.org/t/can-multisite-instances-communicate-with-one-another/8984?u=erlend_sh

1 个赞

Are there any newer/better approaches to this since the last post? This is something we want to do as well.

We definitely want to share user profiles so that badges (for example) only have to be earned once overall, not once per site.

Using discourse in multiple sites with shared accounts? suggests that just SSO will do the trick but Multiple sites with the same user accounts? suggests that using SSO just takes care of the authentication (credentials) but nothing else.

If you want shared badges, like using the sum for each site to get a badge, you gotta use a single forum and categories to separate stuff.

5 个赞

那么,处理这种情况的最佳方式是什么?是建立一个中心主站,并在其他网站上嵌入 Discourse 链接(这样他们的讨论帖子实际上就存储/“位于”中心站上)吗?

“最佳”是相对的,如果不说明你的能力的话。

最简单的方法正如你上方帖子中所说:使用单个实例。

如果你具备相应的工程能力,或者拥有等效的预算,你可以部署多个实例共享一个单点登录(SSO),并配套一个应用程序,该程序通过 API 调用查询所有姊妹 Discourse 实例的数据,并在每个实例中为用户授予徽章。

3 个赞

所以本质上这是一个单点登录(SSO)个人资料同步插件。据你所知,目前有类似的产品吗?是否有人已经在开发类似的东西?我也很感兴趣。

我了解到,当使用 SSO 时,像 Facebook 这样的替代登录方式会丢失。这种情况现在仍然存在吗?中央 Discourse 实例是否也不会保留这些替代登录方式?为什么会这样?

你可以将其中一个 Discourse 实例设为主站点,其他实例则配置为将其主站点作为 SSO 服务器。在这种情况下,主 Discourse 实例可以使用社交登录,而那些将其作为 SSO 服务器的实例会将所有登录请求重定向到主服务器。

如果使用 SSO,则它将是唯一可用的认证方式。如果你希望最佳地将认证委托给另一台服务器,则必须使用 OAuth2。

1 个赞

当来自从属 Discourse 的用户尝试登录时会发生什么?他们会被重定向到主 Discourse 的账户创建页面,该页面包含我想要的任何社交媒体登录选项;创建成功后,他们会被重定向回从属 Discourse,并被要求使用什么凭据登录?如果用户使用的是 Facebook 等社交媒体登录方式呢?问题有点长,抱歉,如果表述不清我可以重新组织……基本上,在一个依赖主 Discourse 的 Discourse 网络中,如果主 Discourse 支持社交媒体登录,那么从属 Discourse 是使用存储在主 Discourse 上的本地认证信息,还是仍然直接使用 Facebook 等第三方认证?这似乎会让本地密码管理器感到困惑。

简而言之:我希望我的主 Discourse 和所有从属 Discourse 都支持社交媒体登录。

客户端会重定向到主对话服务进行身份验证,用户在此处登录。该服务支持社交登录。

客户端对话站点无法得知用户是否通过社交方式登录(至少我认为如此)。

2 个赞

所以当客人在从节点登录时,会被重定向到主节点,在那里通过社交账号登录后,再被重定向回从节点并处于登录状态,是这样吗?

1 个赞