我正在尝试通过Keycloak服务来改善Moodle登录。
我在本地实例上安装了此插件(https://moodle.org/plugins/auth_oidc),安装后我开始编译所有字段。
该插件在登录页面上提供了一个按钮,单击该按钮将重定向到我的keycloak登录页面。
当我在密钥斗篷上按“登录”时,我期望返回的页面是“注册页面”之类的页面,用户可以在其中添加自己,但得到的是我没有登录,并且显示此错误:
Debug info:
Error code: erroroidccall
×堆栈跟踪:
line 47 of /auth/oidc/classes/utils.php: moodle_exception thrown
line 252 of /auth/oidc/classes/oidcclient.php: call to auth_oidc\utils::process_json_response()
line 177 of /auth/oidc/classes/loginflow/authcode.php: call to auth_oidc\oidcclient->tokenrequest()
line 84 of /auth/oidc/classes/loginflow/authcode.php: call to auth_oidc\loginflow\authcode->handleauthresponse()
line 105 of /auth/oidc/auth.php: call to auth_oidc\loginflow\authcode->handleredirect()
line 29 of /auth/oidc/index.php: call to auth_plugin_oidc->handleredirect()
此错误在多文档中没有解释。
我看过php,但没有发现任何帮助。在插件的代码中,我尝试搜索handleredirect()方法,但没有找到。
是否有人使用密钥斗篷(或其他第三方oidc服务)解决了此错误?
我在我的密钥斗篷和Moodle配置上遇到相同的问题。
如果您不是PHP的专家,则可以在252行中编辑(Moodle安装路径)/auth/oidc/classes/oidcclient.php
的文件,并进行如下编辑:
然后在您的Moodle页面中重试登录,结果将如下所示:
这里您可以查看错误详细信息,在我的情况下是DNS问题。