Google Identity Toolkit - 密码重置流程已中断

时间:2018-06-17 09:49:02

标签: google-identity-toolkit

我在我的网站上使用Google Identity Toolkit(用于网络)超过2年。最近我发现密码重置流程被破坏了。当我尝试“忘记密码”时,检查重新访问复选框并单击继续,我收到错误“请求失败。请再试一次。”

在控制台中我看到了:

[ 28.949s] [identitytoolkit] Error: Invalid JSON string: Password reset email sent successfully.
     Gj @   gitkit.js:254
Ej.addLogRecord @   gitkit.js:254
Zi.log  @   gitkit.js:237
R   @   gitkit.js:254
(anonymous) @   gitkit.js:255
Yc  @   gitkit.js:44
g.dispatchEvent @   gitkit.js:42
tj  @   gitkit.js:247
lj.onReadyStateChangeEntryPoint_    @   gitkit.js:245
lj.onReadyStateChange_  @   gitkit.js:245
XMLHttpRequest.send (async)     
lj.send @   gitkit.js:242
Mj  @   gitkit.js:255
Lj.requestRpEndpoint    @   gitkit.js:256
g.requestRpEndpoint @   gitkit.js:259
(anonymous) @   gitkit.js:4
N   @   gitkit.js:190
Fh  @   gitkit.js:190
Sm  @   gitkit.js:334
(anonymous) @   gitkit.js:335
(anonymous) @   gitkit.js:80
(anonymous) @   gitkit.js:77
Yc  @   gitkit.js:44
g.dispatchEvent @   gitkit.js:42
fd  @   gitkit.js:47
ed.handleClick_ @   gitkit.js:47
Uc  @   gitkit.js:39
Rc  @   gitkit.js:41
Pc.b    @   gitkit.js:37

即使错误显示“电子邮件已成功发送”,也不会发送。我不知道它被打破了多久。我昨天才发现它。

我正在使用这个脚本:

https://www.gstatic.com/authtoolkit/js/gitkit.js在我的网站上。

我希望来自Gooogle Identity Toolkit团队的人可以提供帮助。

更新1:

服务器端代码:

OobResponse oobResponse = gitkitClient.getOobResponse(request);
OobAction oobAction = oobResponse.getOobAction();

// For DEBUG
logger.info("oobAction : " + oobAction);
String action = request.getParameter("action");
logger.info("action : " + action); // returns null
logger.info("response: " + request.getParameter("response")); // returns a long string
logger.info("responseBody : " + oobResponse.getResponseBody()); // returns {"error": "CAPTCHA_CHECK_FAILED" }
logger.info("email : " + oobResponse.getEmail()); // returns null

// If reset password
if (OobAction.RESET_PASSWORD.equals(oobAction)) {
    Optional<String> forgotPasswordLinkOpt = oobResponse.getOobUrl();               
    String passwordResetLink = forgotPasswordLinkOpt.get();

    sendMailService.sendPasswordResetEmail(oobResponse.getEmail(), passwordResetLink);

    return(oobResponse.getResponseBody());              
}   

oobAction即将出现null,因此未发送链接。但action的值为resetPassword。 'responseBody'正在回归 {"error": "CAPTCHA_CHECK_FAILED" }。我是否需要在结束时对recaptcha字符串进行一些配置?

我正在使用Maven回购中的gitkitclient v1.2.7:

https://mvnrepository.com/artifact/com.google.identitytoolkit/gitkitclient

1 个答案:

答案 0 :(得分:0)

该问题已由Google团队在后端修复,而我对此没有任何更改。有关详细信息,请参见原始问题的评论。