identityserver4 - 如何退出谷歌外部供应商?
问题描述
现在我可以退出 Identity Server。但是在重新登录时,我只需选择我的电子邮件地址(无需重新输入密码)即可通过 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");
})
非常感谢您的帮助!如果您需要更多信息,请告诉我:)
解决方案
不幸的是,谷歌不会通过前通道注销来宣传end_session
端点。https://accounts.google.com/.well-known/openid-configuration
但是,您可以prompt=login
在授权端点请求中提供附加参数,以尝试强制进行交互式身份验证。您可以通过检查auth_time
索赔是否是最近的,在您的客户中强制执行此操作。
推荐阅读
- spring - 身份验证前的spring security + spring boot mvc索引页面看起来像裸html
- postgresql - SQL 脚本未运行 Kubernetes,但仅使用 Docker 即可正常运行
- node.js - 如何以 JSON 格式获取具有温度和降雨信息的坐标(纬度和经度)的世界地球数据?
- javascript - HTML 对象上的事件处理程序中的 this
- swift - 尝试使用 AVCapturePhotoOutput 捕获照片时图像变暗
- concatenation - 如何在顶点连接两个地图
- javascript - 是否可以将嵌套数组拆分为Js中的两个数组
- html - 如何隐藏/删除前一个 div 的背景图片
- lua - 更新openwrt web界面luci中的变量信息
- java - 串行蒸汽的性能、内部工作和执行顺序