【发布时间】:2018-10-26 02:05:53
【问题描述】:
我正在尝试将 Google 身份验证与我的 ASP.Net 核心应用程序集成。在登录 google 重定向回应用程序主页后,我已成功地将应用程序与 Google 身份验证集成。但是,我希望它重定向到https://localhost:44303/Home/dashboard。
为了解决这个问题,我已将“授权重定向 URI”从 https://localhost:44303/signin-google 更改为 https://localhost:44303/Home/dashboard,但是当我这样做时,我收到了 redirect_uri_mismatch 错误。我需要遵循特定的“授权重定向 URI”格式吗?我检查了https://developers.google.com/identity/protocols/OAuth2WebServer 的文档,但也许我遗漏了一些非常明显的东西。
OAuth 同意屏幕:我无法在“授权域”文本框中添加 localhost。
OAuth 客户端限制:如果我在授权的重定向 URL 中添加 https://localhost:44303/Home/dashboard,则会收到 redirect_uri_mismatch 错误。
堆栈跟踪: 错误:redirect_uri_mismatch
The redirect URI in the request, https://localhost:44303/signin-google, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit: https://console.developers.google.com/apis/credentials/oauthclient/685730099587-d2rac5lt7981tjkoo5td23ogm2q1at20.apps.googleusercontent.com?project=685730099587
Learn more
Request Details
response_type=code
client_id=685730099587-d2rac5lt7981tjkoo5td23ogm2q1at20.apps.googleusercontent.com
redirect_uri=https://localhost:44303/signin-google
scope=openid profile email
state=CfDJ8HG_FpcxsWVNk9Pwwx_Fh6NNjkmrebqlP7rA3Y3u0fx42o-r6KMmiNmbmC2vjIuZLqmTZMA8O8AfMgIxXO8Tj9k3x2PLe6wNyL7xqOXi6Yj-AJUmeZFwievUqEAuCKHClYJOFPAlKTxrnYIYCXoJjvwg8BM4JBKA_NgFGjy_CbGHrI2kyUC63Z7INhYHdwEyO13AsBfYXR4LfxAGf3jz3x8-ZKDUDgFOqYYKXXcDHt2VqlERXOVXdEqNUcxUtfhM
【问题讨论】:
标签: asp.net-core google-plus google-oauth google-plus-signin