简体   繁体   English

谷歌 Oauth 即使在验证应用程序后也无法登录

[英]Google Oauth not sign-in not working even after app is verified

We were setting up google oauth signin for our website.我们正在为我们的网站设置 google oauth 登录。 For testing purpose we have added our test email xxx@gmail.com and then submitted add for verification出于测试目的,我们添加了我们的测试 email xxx@gmail.com 然后提交添加进行验证

The problem we are facing is, even though our app is in verified status, our app is not working for all emails.我们面临的问题是,即使我们的应用程序处于已验证状态,我们的应用程序也不适用于所有电子邮件。 It is working for only for xxx@gmail.com.它仅适用于 xxx@gmail.com。 but other emails its is throwing但它正在抛出其他电子邮件

{ "error": "invalid_grant", "error_description": "Bad Request" } { "error": "invalid_grant", "error_description": "Bad Request" }

upon trying to get access_token https://oauth2.googleapis.com/token using authorization code.在尝试使用授权代码获取 access_token https://oauth2.googleapis.com/token 时 sample auth_code: 4/0AX4XfWh4w99xccU1rPd2qi4hRUkp0Tyya7bOs373nDLbCXjrjvnWxY6uCgiZKRlXeimiFQ We are struck on this for quite sometime screen shots sample auth_code: 4/0AX4XfWh4w99xccU1rPd2qi4hRUkp0Tyya7bOs373nDLbCXjrjvnWxY6uCgiZKRlXeimiFQ 我们在相当长的一段时间内对这个屏幕截图感到震惊

验证状态

The proper request exchanging the authorization code is.交换授权码的正确请求是。

HTTP Post https://accounts.google.com/o/oauth2/token
code=4/X9lG6uWd8-MMJPElWggHZRzyFKtp.QubAT_P-GEwePvB8fYmgkJzntDnaiAI&client_id={ClientId}&client_secret={ClientSecret}&redirect_uri=urn:ietf:wg:oauth:2.0:oob&grant_type=authorization_code

If you are getting invalid_grant from that, this would sugest that the authorizaotn code has either expired as they are only good for under five minutes.如果您从中获得invalid_grant ,这表明授权代码已经过期,因为它们只能在五分钟内有效。 or the authorization code has in fact been used previously in which case it will no longer work.或者授权代码实际上以前已经使用过,在这种情况下它将不再有效。

It could also be that the client id and client secrets you are sending are not the ones that were used to get the authorization code to begin with.也可能是您发送的客户端 ID 和客户端机密不是用于获取授权代码的那些。

invalid_grant errors invalid_grant错误

  • invalid_grant Your server's clock is not in sync with NTP. invalid_grant 您的服务器时钟与 NTP 不同步。 (Solution: check the server time if its incorrect fix it. ) (解决办法:检查服务器时间,如果不正确修复它。)
  • invalid_grant: Code was already redeemed (you can only use authorizaton code once) invalid_grant: code 已经被兑换(授权码只能使用一次)
  • invalid_grant: Invalid JWT (refrsh token expired) invalid_grant:无效 JWT(刷新令牌已过期)
  • Invalid_grant: bad request (client id and client secret don't match refresh token / authorizaotn code) Invalid_grant:错误请求(客户端 ID 和客户端密码与刷新令牌/授权代码不匹配)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我的 Flutter 应用程序中的 Google 登录失败 - Google sign-in is failing in my Flutter app Flutter Google 登录不工作平台异常 - Flutter Google Sign-In not working platformexception Firebase 使用email登录后google登录报错:密码无效或用户没有密码 - Firebase Sign-in with email after google sign-in has error : The password is invalid or the user does not have a password 使用 Google 登录“访问被阻止:此应用的请求无效” - Sign-In with Google "Access blocked: This app's request is invalid" Google firebase 首次登录时显示没有 email 选项 - Google firebase Sign-in show no email option on first sign-in 批准和发布的 Google OAuth 同意屏幕仍然显示“此应用未经验证”错误 - Approved & Published Google OAuth consent screen still gives "This app isn't verified" Error 如果应用仅使用 Google 登录 Firebase,如何为 Google Play 商店提供演示帐户? - How to provide demo account for Google Play Store if app uses only Google Sign-in Firebase? 获取谷歌登录的accessToken(安卓) - Obtaining accessToken for google sign-in (Android) 在 Play 商店中发布后,Google 登录无法正常工作 - Google sign in not working after publishing in play store 返回 RESULT_CANCELED 的 Google 登录片段 - Google sign-in fragment returning RESULT_CANCELED
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM