【发布时间】:2015-10-01 20:47:10
【问题描述】:
为我的 Angular 应用实现 https://developers.google.com/identity/sign-in/web/reference 并且登录/注销工作正常。
但是,当我为cookie_policy 参数设置域时(尝试localhost 和.com 域),在选择我的帐户后,它会在控制台中返回400 错误。错误的 URL 如下:
https://accounts.google.com/o/oauth2/iframerpc?action=issueToken&response_type=token%20id_token&scope=openid%20profile%20email&client_id=...apps.googleusercontent.com&login_hint=AJDL...r5Pg&ss_domain=http%3A%2F%2Flocalhost&origin=http%3A%2F%2Flocalhost%3A8000
具体报错信息为:
{
"error" : "invalid_request",
"error_description" : "invalid login_hint."
}
这阻碍了我通过跨子域共享的 gapi.auth2 实现身份验证。
谢谢!
【问题讨论】:
-
嗯,它说你有一个无效的登录提示,所以可能先解决这个问题,然后根据this answer 你应该能够使用单主机源或无用于开发或您的顶级域的 url,它也应该适用于子域
标签: google-oauth google-signin