Php Moodle从外部网站接受从外部网站登录
我们正在将Moodle添加到我们的站点(不同的服务器、不同的子域,但相同的主域,并且服务器被设置为能够相互通信),我们希望它能够做到:Php Moodle从外部网站接受从外部网站登录,php,yii2,Php,Yii2,我们正在将Moodle添加到我们的站点(不同的服务器、不同的子域,但相同的主域,并且服务器被设置为能够相互通信),我们希望它能够做到: 如果用户访问主站点 用户登录用户单击Moodle的链接 用户将自动登录到Moodle,无需登录 必须重新输入他们的信息 我在我的主域名中添加了带有隐藏类型的html表单作为moodle post url 主域名: <form class="mt-3" action="http://localhost/moodle/login/
<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>
document.getElementById('anchor')。value=location.hash;
用户名/电子邮件
密码
记住用户名
登录
如何在moodle中接受此请求?或者,如果您对这个问题有任何疑问,请帮我解决。不知道是否可能与Moodle合作。我们在使用CAS(中央认证服务)的多个系统上实现了这一点,其中多个yii2应用程序针对使用web2py实现的CAS登录 在Yii端,我们用于用户管理和针对CAS的身份验证
也许您需要在Yii上实现CAS,并检查如何使Moodle对其进行身份验证。你好,Harsha,欢迎使用StackOverflow。你能添加你正在运行的moodle版本吗?看看。您可能需要一个CAS/SSO服务器是的,那里有CAS,还有看起来很有趣的外部数据库。。。