我试图在服务器上使用Google,但是Google的弹出窗口没有显示要选择登录的google帐户。当我在本地测试它并能够登录时,它就能工作了。
我正在使用包react-oauth/google
我通过Google控制台在Credentials
中添加了服务器详细信息。以下是Authorized JavaScript origins
和Authorized redirect URIs
配置中的URL
http://localhost
http://localhost:9998 ## React app is running on this port
http://example.com:9998 ## Server url can be accessed using domain and port
当下面的url被称为https://accounts.google.com/gsi/button
时,我得到了403个错误
下面是在cosole中显示的错误
[GSI_LOGGER]: The given origin is not allowed for the given client
尝试清除缓存和硬重新加载。也不起作用。
它与使用端口和域名有关吗?
编辑:我也尝试过创建新的凭据。但这也行不通
发布于 2022-11-18 11:17:31
我在工作上也有同样的问题。您的网站有ssl证书吗?如果不尝试添加ssl (否则google没有它就无法工作),然后用Authorized JavaScript origins
和Authorized redirect URIs
中的url更改https
url。这应该能解决问题。(请让我知道它是否有效:)
https://stackoverflow.com/questions/73685378
复制相似问题