Can't reset user's password in Google Identity Toolkit: “CAPTCHA_CHECK_FAILED”

柔情痞子 提交于 2019-12-10 23:43:20

问题


I'm trying to setup my Google Identity Toolkit so users can reset their passwords. I'm following the documentation here: https://developers.google.com/identity/toolkit/web/required-endpoints#send_email_url

I'm using the PHP Gitkit Client outlined here: https://github.com/google/identity-toolkit-php-client/blob/master/src/GitkitClient.php

Specifically the function getOobResults() on line 307 seems to be unhappy for some reason. Here's where I'm at:

  1. User sets up account and logs in successfully
  2. User then logs out and starts to log back in, enters email in and clicks "Forgot password"
  3. reCaptcha is shown, click check box and then hit continue

At this point my 'Send Email URL' endpoint (gitkitEmail.php) is successfully called and the following POST is set to it (dropping the full '&response' param since it goes on for a while):

action=resetPassword&email=xodfebefa%40nada.ltd&challenge&response=03ACgFB9tGlNt2KAGhrVY....

I then take that string and parse it using parse_str(); since getOobResults() is looking for an array. However, response I get back is always:

{
  "response_body": {
    "error": "CAPTCHA_CHECK_FAILED"
  }
}

I searched around but can't find any details on this error. Any help would be appreciated. I don't have a reCaptcha setup anywhere on my site, unsure if this is expecting me to do that and that's why it's failing? Also, I did bump all my code to a production environment and got the same error there as I did on my localhost.

来源:https://stackoverflow.com/questions/50691691/cant-reset-users-password-in-google-identity-toolkit-captcha-check-failed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!