Google登录:拒绝为目标域(JavaScript Web应用程序)生成登录提示的权限 [英] Google signin: Permission denied to generate login hint for target domain (javascript web app)

查看:436
本文介绍了Google登录:拒绝为目标域(JavaScript Web应用程序)生成登录提示的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Web应用程序上使用Google登录Javascript API(即gapi-signin-button).该应用程序由Gulp服务器提供服务,并绑定到0.0.0.0.当我在本地开发时,登录过程有效,但是当我在远程服务器上运行并通过公共IP访问页面时,出现以下登录错误:

I'm using the Google signin Javascript API (that is, the gapi-signin-button) on a webapp. The app is served by a gulp server, binding to 0.0.0.0. The login process works when I develop locally, but when I run on a remote server and access the page via the public IP, I get the following signin error:

Error: invalid_request
Permission denied to generate login hint for target domain.

在我的授权JavaScript来源中,我同时拥有localhost:PORTSERVER_IP:PORT.其他SO回答说我应该绑定到localhost而不是其他接口,但这在这里不适用,因为如果我绑定到localhost,则无法远程访问服务器.做什么?

I have both localhost:PORT and SERVER_IP:PORT in my Authorized JavaScript origins. Other SO answers have said I should be binding to localhost instead of other interfaces, but that doesn't apply here since if I bind to localhost the server can't be accessed remotely. What do?

推荐答案

我遇到了同样的问题,只是想出了办法.您不能在Google中使用数字IP地址(例如 http://0.0.0.0 )作为重定向uri.它必须是实际的网址,例如 http://mycompany.com .

I had this same problem and just figured it out. You can't use numerical ip addresses (like http://0.0.0.0) as redirect uris in Google. It has to be an actual url, like http://mycompany.com.

这篇关于Google登录:拒绝为目标域(JavaScript Web应用程序)生成登录提示的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆