我已将此功能添加到插件中。只需将其更新到最新版本,然后将 discourse rocketchat default channel 设置设置为空。
太棒了!我下周回到住处后会立即更新并进行测试。\n再次感谢!
此插件在我这边给所有用户都带来了一些问题:
点击“登录 CAS”按钮后,会弹出一个包含以下链接的窗口:
rocketchat.domain/_cas/BJZ6ef4aSDdeEf5C?ticket=c27a3525gg4ggff7f859f4a3a37c
(为安全起见,我随机化了粘贴令牌的某些部分)。
这是一个空白页面,不会自动关闭,并且除非用户关闭该窗口,否则登录不会继续。一旦用户关闭此弹出窗口,登录就会继续,之后一切正常。每次有人尝试登录时都会发生这种情况,即使是以前登录过的用户也是如此。
您能让自动重定向生效吗?我尝试了@RGJ的自定义脚本以及这个CAS Plugin: Add direct login redirect for a CAS-enabled RC instance · Issue #2327 · RocketChat/Rocket.Chat · GitHub
它是一个空白页面,不会自行关闭,并且除非用户关闭窗口,否则登录不会继续。
那里有一个内联脚本来关闭该窗口,但它可能未在您的 CSP 中列入白名单。
作为一种快速修复方法,在 Rocket.Chat 端,转到“管理” - “常规”并禁用“启用内容安全策略”。请注意,这可能会使您的站点面临安全风险。您应该解决根本问题。
请将此处的所有报告和请求限制在与插件相关的问题上。在 Rocket.Chat 或您的 Rocket.Chat 主机名内发生的任何错误,都应视为 Rocket.Chat 问题,而不是 Discourse 或插件的问题。
我已将此功能添加到插件中。只需将其更新到最新版本,然后将
discourse rocketchat default channel设置设置为空。
我测试了新版本,效果很棒!非常感谢!
Mr.X_Mr.X:
it’s a blank page that doesn’t close itself and the login is not proceeding unless the user closes the window.
There is an inline script there to close that window which is probably not being whitelisted in your CSP.
As a quick fix, on Rocket.Chat side, go to Admin - General and disable “Enable Content-Security-Policy”. Please note that this might open up your site to security issues. You should address the underlying problem.Please limit all reports and requests here to issues concerning the plugin. Any error that is happening within Rocket.Chat or on your Rocket.Chat hostname, should be considered a Rocket.Chat issue and not an issue of Discourse or the plugin.
@Mr.X_Mr.X ,我之前也遇到过同样的问题,就是那个空白窗口关不掉,我当时以为是我的CAS配置有什么问题。
我禁用了 Content-Security-Policy,现在空白窗口可以自己关闭了。谢谢 Richard 解释了问题所在!
不过,我还是想知道如何添加例外并启用这个安全功能。
@RGJ 抱歉打扰,但这个问题不应该和你的插件有关吗?内联脚本是嵌入在你的插件里的吗?还是你说的是在 Rocket.Chat 端手动添加的内联脚本?
再次感谢。
这个问题是不是和你的插件有关?内联脚本是否嵌入在你的插件中?
不,它在 Rocket.Chat 中的 CAS 弹出窗口中(您可以看到弹出窗口的 URL 是在 RC 主机名上)。
好的,抱歉,我保证这是最后一个问题:
那么,您建议为 Rocket.Chat CSP 添加白名单(可能添加 Discourse 域,我猜)吗?
您会建议向 Rocket.Chat CSP 添加白名单(可能添加 Discourse 域名)吗?
不,这 100% 是 Rocket.Chat 端的问题。Rocket.Chat 的 Javascript 正在尝试关闭一个 Rocket.Chat 弹出窗口,但根据 Rocket.Chat CSP 的规定,它不允许这样做。
它发生在 Rocket.Chat 中的所有登录弹出窗口,如 CAS 或 OAuth2。如果您搜索一下,您也会找到其他报告。
太好了。再次非常感谢您的解释!
是否有办法设置特定主题的频道?这样,如果插件显示在此主题上,频道将自动设置为“rocket-chat-sso-embed-plugin-for-discourse”?