drzbc6003 2014-05-16 17:39
浏览 28
已采纳

token.php返回usernamenotfound

I'm making an educational app where the user must login using moodle username and password and along with other stuff there will be moodle information.

The problem is that we found out that we can validate (and enable webservices access) through the token.php request. But the only thing that we get as a return is:

{
"error": "The username was not found in the database",
"stacktrace": "* line 179 of /login/token.php: moodle_exception thrown
",
"debuginfo": "
Error code: usernamenotfound",
"reproductionlink": "http://#####.com/"
}

We trying changing the shortname, setting on .php file, but nothing seems to work.

So we need to know if there is anything we can do to fix it or we are possibly using the wrong function.

Just to note, the Moodle version we are using is the 2.3.1

Thanks in advance.

  • 写回答

1条回答 默认 最新

  • duanchifo2866 2015-02-09 19:43
    关注

    I had the same problem. It appeared to be that I had a password for the user containing non-alphanumerical characters. This caused a UTF-8 problem.

    In the settings I changed the requirement that a password must contain 1 non-alphanumeric character, so I could give the webservice user a alphabetic password. token.php worked OKE after that.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 抖音咸鱼付款链接转码支付宝
  • ¥15 ubuntu22.04上安装ursim-3.15.8.106339遇到的问题
  • ¥15 求螺旋焊缝的图像处理
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面
  • ¥15 itunes恢复数据最后一步发生错误
  • ¥15 关于#windows#的问题:2024年5月15日的win11更新后资源管理器没有地址栏了顶部的地址栏和文件搜索都消失了