Google OAuth同意屏幕方案错误:无效的域名:不得指定方案。 (http://或https://)

huangapple go评论67阅读模式
英文:

google OAuth consent screen scheme error: Invalid domain: must not specify the scheme. (http:// or https://)

问题

我一直在尝试使用Google OAuth服务,但遇到了一个严重的错误,似乎根本无法正常工作。
Google OAuth同意屏幕方案错误:无效的域名:不得指定方案。 (http://或https://)

这也不起作用,
Google OAuth同意屏幕方案错误:无效的域名:不得指定方案。 (http://或https://)

如何正确解决这个问题?

英文:

I have been trying to use google OAuth service and got a terrible error, which doesnt seem to be just working at all.
Google OAuth同意屏幕方案错误:无效的域名:不得指定方案。 (http://或https://)

nor does this work,
Google OAuth同意屏幕方案错误:无效的域名:不得指定方案。 (http://或https://)

How to resolve this properly?

答案1

得分: 3

授权域字段不接受本地主机地址。

如果您正在尝试为测试应用程序配置OAuth2,您无需在OAuth同意屏幕中指定此域详细信息,只需跳过此字段。

在保存身份验证屏幕的详细信息后,您需要在凭据菜单中指定已授权的重定向URI - 将您的域地址与相应的端点一起放在那里,然后您就可以继续进行了。

英文:

The Authorized domain field does not accept the localhost addresses.

If you are trying to configure the OAuth2 for your test application you do not need to specify this domain detail for the OAuth consent screen, just skip this field.

Upon saving details for the authentication screen you will need to specify the Authorized redirect URIs in the Credentials menu - put your domain address there along with the appropriate endpoint and you will be good to go.

答案2

得分: 1

我需要编辑我的/etc/hosts文件:

##
# 主机数据库
#
# 当系统启动时,localhost用于配置回环接口。不要更改此条目。
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
127.0.0.1 test.cc

然后在本地以test.cc:3000而不是localhost:3000运行开发服务器。当然,test.cc是一个任意的名称,您可以使用任何您喜欢的名称。

完成后,请将该域名提交为您的OAuth同意屏幕上的授权域。

英文:

For me I had to edit my /etc/hosts folder

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1             localhost
127.0.0.1 test.cc

then run instead of localhost:3000 dev locally on test.cc:3000. Of course test.cc is an arbitrary name you can put what ever you want.

Once this is done submit that domain as an authorized domain on your OAuth consent screen.

Google OAuth同意屏幕方案错误:无效的域名:不得指定方案。 (http://或https://)

huangapple
  • 本文由 发表于 2023年5月28日 16:11:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/76350539.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定