google 在 Elastic beanstalk 上部署我的应用程序后出现 oauthn 错误 400 redirect_uri_mismatch

google oauthn error 400 redirect_uri_mismatch after deploy my application on Elastic beanstalk

我正尝试在我的应用程序上使用 google 身份验证。它在我的本地主机上运行良好,我可以通过我的 google 帐户登录。

然而,在我将应用程序部署到 aws Elastic beanstalk 后,google 身份验证将错误页面显示为:错误 400:redirect_uri_mismatch 我单击它显示的更多信息:redirect_uri : http://myapplication-env.eba-g8xxcswz.us-east-1.elasticbeanstalk.com/authorize.

然后我转到 google 云平台并添加一个授权重定向 URI 作为:https://myapplication-env.eba-g8xxcswz.us-east-1.elasticbeanstalk.com/authorize 但我仍然无法通过 google 在 elastic beanstalk 部署上登录 url.

有人可以帮我解决这个问题吗?非常感谢。

重定向 uri 必须与您在 Google 开发者控制台中注册的完全匹配。

如果它说您的系统正在发送

http://myapplication-env.eba-g8xxcswz.us-east-1.elasticbeanstalk.com/authorize.

那你需要注册一下。

但是您已经注册了 https://myapplication-env.eba-g8xxcswz.us-east-1.elasticbeanstalk.com/authorize。即 https。它必须完全匹配。

因此,要么修复您的应用,使其 运行 在 https 上,要么添加 http 重定向 uri。请注意,如果其 运行 http.

可能无法在生产中设置或验证应用程序