【发布时间】:2015-08-09 14:41:03
【问题描述】:
JSON 文件
{"web":{"auth_uri":"https://accounts.google.com/o/oauth2/auth",
"client_secret":"c-kaafSexciO7It3QcKxx3BO",
"token_uri":"https://accounts.google.com/o/oauth2/token",
"client_email":"xxx678964-tjkl572knihtgocll9tnadvsdngmnld6@developer.gserviceaccount.com",
**"redirect_uris":["http://www.alfrosia.com"]**,
"client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/798911678964-tjkl572knihtgocll9tnadvsdngmnld6@developer.gserviceaccount.com",
"client_id":"xxx1678964-tjkl572knihtgocll9tnadvsdngmnld6.apps.googleusercontent.com",
"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs",
"javascript_origins":["[http://www.alfrosia.com][1]"]}}
我在上面的 json 文件中指定了正确的重定向 url,但是在身份验证期间它在浏览器上给出了错误的 url 消息。虽然我已经给出,this 作为 json 文件中的重定向 Uri。
在错误消息中它说
redirect_uri=http://localhost:57826/authorize/
是 uri_mismatch 而我没有在 json 中指定它
但是 Google OAuth2 授权失败,在认证过程中出现此错误消息
- Error: redirect_uri_mismatch.
请求详情
scope=https:[//www.googleapis.com/auth/youtube.readonly][3]
response_type=code
redirect_uri=http://localhost:57826/authorize/
access_type=offline
pageId=none
client_id=xxxxx964-tjkl572knihtgocll9tnadvsdngmnld6.apps.googleuserconten
【问题讨论】: