rocket.chat - iframe cust-oauth iframe 命令
问题描述
我正在尝试在网站后端使用 Rocket.Chat 来进行作者之间的交流。我已经让 Rocket.Chat 服务器启动并运行得很好,我的 SSO 可以在网站上正常工作,但是,我在后端特定页面的 iframe 中使用 Rocket.Chat,而我想要让它尝试自动登录,因为个人已经登录到他们的 SSO 以到达那里。我在使用 iframe auth 命令“call-custom-oauth-login”时遇到问题。这是我的代码片段,不确定我做错了什么或者我是否缺少参数。
<iframe width='100%;' id="iframeId" onload="authenticateIFrame()" height='100%' src="https://myrocketchatdomain.com/channel/general" frameborder="0" SameSite=none onmousewheel="" style="background: transparent;"></iframe> `
`function authenticateIFrame() {
document.getElementById('iframeId').contentWindow.postMessage({
externalCommand: 'call-custom-oauth-login',
service: 'test'
}, '*');
}
“测试”是我在 Rocket.Chat 中创建的 oAuth 的名称,是的,我在 Rocket.Chat 的后端启用了 iFrame 作为 externalCommand: 'logout' 效果很好。
任何帮助都会非常有用,我一直在努力解决这个问题哈哈
解决方案
推荐阅读
- r - 将分位数结果转换为列名
- r - 如何在 Shiny App 中运行功能时更新进度条
- javascript - 表格排序器过滤器和切换隐藏行不能一起工作
- scala - 如何通过Scala中列的哈希对数据集进行排序?
- python - 如何在 .bat 文件中使用“if __name__ == '__main__':”?
- reporting-services - 如何避免将空的多选参数传递给报表
- javascript - 查找所有未禁用的元素
- typescript - Jest 测试套件无法在 typescript 中从 'vscode' 导入 *as vscode
- javascript - 如何从 Vue 中的方法中获取“this”不是未定义的?
- html - 如何居中多行 inline-flex