【发布时间】:2015-10-03 13:11:24
【问题描述】:
我正在使用 Google.Apis.Auth.OAuth2.GoogleWebAuthorizationBroker.AuthorizeAsync() 对 Google 帐户进行身份验证,问题是我登录 Google 帐户后 Google 返回 400 错误:
请求中的重定向 URI:http://localhost:40745/authorize/ 与注册的重定向 URI 不匹配。
但我的 mvc 应用程序在 46423 运行,并且重定向 URI 在开发控制台中设置为 http://localhost:46423/authorize/。我错过了什么?
【问题讨论】:
-
我不知道。我什么都看不见。没有任何代码很难说
-
Google 对重定向 URI 不要求 https 吗?
-
原来我在 Google 开发控制台的设置中使用了错误的应用程序类型。当我更改为“已安装的应用程序”时,我从 google 获得了正确的回调 url。