drzbc6003 2014-05-16 09: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 11: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 PADS Logic 原理图
  • ¥15 PADS Logic 图标
  • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
  • ¥20 气象站点数据求取中~
  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了