如何退出谷歌外部提供商?



现在我可以注销身份服务器。但是当重新登录时,我只需选择我的电子邮件地址 - 无需重新输入密码 - 通过Google登录以访问我的应用程序。 我想重新输入密码(因为设备在多个用户之间共享(。我遵循了文档,但我一定错过了一些东西。

(我正在使用MVC客户端进行测试( 以下是客户端的配置:

{
"Enabled": true,
"EnableLocalLogin": false,
"ClientId": "backOffice.mvc",
"ClientName": "BackOffice client",
"ClientSecrets": [
{
"Value": "xxx"
}
],
"AllowedGrantTypes": [
"hybrid"
],
"AllowedScopes": [
"openid",
"offline_access",
"profile"
],
"RedirectUris": [
"http://localhost:5098/signin-oidc"
],
"PostLogoutRedirectUris": [
"http://localhost:5098/"
],
"RequireConsent": false,
"AllowOfflineAccess": true
}

和提供程序设置:

.AddOpenIdConnect("Google", "Google", options =>
{
options.SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme;
options.ForwardSignOut = IdentityServerConstants.DefaultCookieAuthenticationScheme;
options.Authority = "https://accounts.google.com/";
options.ClientId = Configuration["GoogleClientId"];
options.CallbackPath = "/signin-google";
options.Scope.Add("email");
})

非常感谢任何帮助!如果您需要更多信息,请告诉我:)

不幸的是,Google 不会通过https://accounts.google.com/.well-known/openid-configuration宣传end_session端点,因此无法选择前台渠道注销。

但是,您可以在授权端点请求中提供额外的prompt=login参数,以尝试强制交互式身份验证。您可以通过检查auth_time声明是否是适当的最新声明,在客户端中强制执行此操作。

最新更新