google 身份验证 return 通过 owin 授权页面后访问被拒绝
google authentication return access denied after authorization page via owin
我尝试使用 Microsoft 和 Google 身份验证服务对我的用户进行身份验证。 Microsoft 服务没有问题,但我有 google 一个问题。
为了总结我的解释,我在 google 控制台管理器中执行了以下任务:
- 启用 google+ API(甚至 google+ 域 API)。
- 添加两个重定向 URL 到我的项目:http://{my website}/signin-google , http://{my website}/account/externallogincallback
然后我按如下方式配置我的 Web 应用程序:
var googleOAuth2AuthenticationOptions = new GoogleOAuth2AuthenticationOptions
{//www.mylocal.com Site clientId
ClientId = "my client Id",
ClientSecret = "my secret",
};
app.UseGoogleAuthentication( googleOAuth2AuthenticationOptions);
问题是:
当用户尝试使用 google 登录时,它成功重定向到 google 授权页面,但是当他授权我的应用程序时,他将重定向到我的回调,但我的应用程序无法访问他的数据。
您可以使用以下 link.
查看我的网站问题
我错误地将“client secret”填入了“client key”的值。当 google 服务将请求重定向到我的 Web 应用程序(在服务器端)时,我的应用程序尝试使用不正确的客户端密码访问数据。换句话说,google 没有 return 访问我的网络应用程序的令牌。 link 详细解释了我的场景。下面一段解释我的情况。
The authorization sequence begins when your application redirects a
browser to a Google URL; the URL includes query parameters that
indicate the type of access being requested. Google handles the user
authentication, session selection, and user consent. The result is an
authorization code, which the application can exchange for an access
token and a refresh token.
我尝试使用 Microsoft 和 Google 身份验证服务对我的用户进行身份验证。 Microsoft 服务没有问题,但我有 google 一个问题。
为了总结我的解释,我在 google 控制台管理器中执行了以下任务:
- 启用 google+ API(甚至 google+ 域 API)。
- 添加两个重定向 URL 到我的项目:http://{my website}/signin-google , http://{my website}/account/externallogincallback
然后我按如下方式配置我的 Web 应用程序:
var googleOAuth2AuthenticationOptions = new GoogleOAuth2AuthenticationOptions
{//www.mylocal.com Site clientId
ClientId = "my client Id",
ClientSecret = "my secret",
};
app.UseGoogleAuthentication( googleOAuth2AuthenticationOptions);
问题是: 当用户尝试使用 google 登录时,它成功重定向到 google 授权页面,但是当他授权我的应用程序时,他将重定向到我的回调,但我的应用程序无法访问他的数据。
您可以使用以下 link.
查看我的网站问题我错误地将“client secret”填入了“client key”的值。当 google 服务将请求重定向到我的 Web 应用程序(在服务器端)时,我的应用程序尝试使用不正确的客户端密码访问数据。换句话说,google 没有 return 访问我的网络应用程序的令牌。 link 详细解释了我的场景。下面一段解释我的情况。
The authorization sequence begins when your application redirects a browser to a Google URL; the URL includes query parameters that indicate the type of access being requested. Google handles the user authentication, session selection, and user consent. The result is an authorization code, which the application can exchange for an access token and a refresh token.