[英]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 和客户端机密不是用于获取授权代码的那些。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.