启用 Google 登录以接受来自多个托管域(即 GSuite 域)的登录

Currently, the “google oauth2 hd” login setting can either be left blank (allowing login from any Gmail or GSuite/hosted domain account), can be set to * (allowing login from any GSuite/hosted domain account), or can be set to a single GSuite domain name (allowing login from accounts in one GSuite/hosted domain.) A fourth option – already supported by the underlying omniauth-google-oauth2 gem but not currently supported by Discourse – is to specify a list of hosted/GSuite domains (allowing logins from accounts in any one of the specified GSuite domains.)

In other systems, I’ve seen this done by allowing multiple domain names to be comma-delimited or space-delimited in the corresponding setting (google oauth2 hd at <discourse>/admin/site_settings/category/login.) An incomplete PR along these lines can be found at FEATURE: Allow Google Login to be enabled for multiple hosted domains. by aribn · Pull Request #6067 · discourse/discourse · GitHub

8 个赞

我想支持这项功能请求。我们学校使用两个不同的域名:一个用于学生(alum.college.com),另一个用于教职员工(college.com)。我们希望学生和教职员工都能通过 Google 登录访问我们的 Discourse 论坛。许多学院都采用类似的域名拆分系统,以区分学生和教职员工的电子邮件地址。

1 个赞