首页 > 解决方案 > 如何退出谷歌外部供应商?

问题描述

现在我可以退出 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");
                })

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

标签: identityserver4

解决方案


不幸的是,谷歌不会通过前通道注销来宣传end_session端点。https://accounts.google.com/.well-known/openid-configuration

但是,您可以prompt=login在授权端点请求中提供附加参数,以尝试强制进行交互式身份验证。您可以通过检查auth_time索赔是否是最近的,在您的客户中强制执行此操作。


推荐阅读