当使用google oAuth2时。我一直使用HTTP访问来获取Erreur 400 : redirect_uri_mismatch The redirect URI in the request, http://hostname/signin-google, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit:。但我正在使用https访问访问url。我不知道它为什么要通过HTTP而不是HTTPS重定向。我要用的是
await HttpContext.ChallengeAsync("Google", new AuthenticationProperties() {RedirectUri = "/"})-注意:当尝试在GCP上的redirect_uris上添加我的主机名时,它不接受http,而只接受HTTPS。
非常感谢
发布于 2021-03-24 13:16:29
事实上,这是你公开你的应用程序的方式,它是以参数..。对我来说,我使用dockerfile来公开我的应用程序,我曾经使用Expose http://*:80,即使关联的域是用HTTPS启动的,在应用程序中它总是一个HTTP调用,所以所有重定向都是通过http协议完成的。我改变了将我的应用程序从http://_:80发布到https://_:443的方式,在代码中,我使用kestrel启动了应用程序,它现在运行得很好。
https://stackoverflow.com/questions/66694764
复制相似问题