如何解决Moodle接受来自外部网站的外部登录
我们正在将Moodle添加到我们的站点(不同的服务器,不同的子域,但相同的主域,并且服务器被设置为能够相互通信),而我们想要做的是:
- 如果用户访问主站点
- 用户登录用户单击Moodle链接
- 用户无需登录即可自动登录Moodle 必须重新输入他们的信息。
我已经在我的主域名中添加了带有隐藏类型的html表单作为穆德(moodle)帖子网址。
主要统治者
<form class="mt-3" action="http://localhost/moodle/login/index.php" method="post" id="login">
<input id="anchor" type="hidden" name="anchor" value="">
<script>document.getElementById('anchor').value = location.hash;</script>
<input type="hidden" name="logintoken" value="xUe9G7a012vTHpvtOxAfzu84YJ046pu4">
<input type="hidden" name="loginhas" value="eda690fdf">
<div class="form-group">
<label for="username" class="sr-only">Username / email</label>
<input type="text" name="username" id="username" class="form-control" value="admin" placeholder="Username / email" autocomplete="username">
</div>
<div class="form-group">
<label for="password" class="sr-only">Password</label>
<input type="password" name="password" id="password" value="eda690fdf" class="form-control" placeholder="Password" autocomplete="current-password">
</div>
<div class="rememberpass mt-3">
<input type="checkbox" name="rememberusername" id="rememberusername" value="1">
<label for="rememberusername">Remember username</label>
</div>
<button type="submit" class="btn btn-primary btn-block mt-3" id="login">Log in</button>
如何在心情中接受此请求?或者,如果您对此问题有疑问,请帮我解决这个问题。
解决方法
不知道是否可以使用Moodle。我们在使用CAS(中央身份验证服务)的多个系统上执行此操作,其中多个yii2应用程序针对通过web2py实现的CAS登录。
在Yii方面,我们使用https://github.com/2amigos/yii2-usuario进行用户管理,并使用https://github.com/daxslab/yii2-cas-client进行针对CAS的身份验证。
也许您需要在Yii上实施CAS,并检查Moodle如何对其进行身份验证。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。