【问题标题】:Cannot Signout the External Identity provider in IdentityServer无法在 IdentityServer 中注销外部身份提供程序
【发布时间】:2018-07-22 05:04:23
【问题描述】:

我有一个使用 IdentityServer4 的 MVC 应用程序。在 IdentityServer4 中,我将 SAML2 (SustainSys.SAML2) 注册为外部登录提供程序。和登录工作正常。

当用户注销 MVC 应用程序时,它会从 MVC 应用程序注销,但不会触发外部登录提供程序的注销。我检查了我的身份服务器的 LogOut 方法,该方法重定向到外部身份验证方案。但重定向不会发生。

  this triggers a redirect to the external provider for sign-out
    return SignOut(new AuthenticationProperties { RedirectUri = url }, 
    vm.ExternalAuthenticationScheme);

这是我为 SAML 注册外部身份提供程序的代码。我使用了 SustainSys SAML 的 Nuget 包。

.AddSaml2(options =>
{
    options.SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme;
    options.SignOutScheme = IdentityServerConstants.SignoutScheme;
    options.SPOptions = CreateSPOptions();
    var idp = new IdentityProvider(new EntityId(_strIDPEntityId), options.SPOptions)
    {
        AllowUnsolicitedAuthnResponse = true,
        Binding = Saml2BindingType.HttpRedirect,
        SingleSignOnServiceUrl = new Uri(_strSingleSignOnURL),
        SingleLogoutServiceBinding = Saml2BindingType.HttpRedirect,
        SingleLogoutServiceUrl = new Uri("https://devit-dev.onelogin.com/trust/saml2/http-redirect/slo/1111")

    };
    idp.SigningKeys.AddConfiguredKey(
    new X509Certificate2(
        AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "../../../App_Data/OneLogin.cer"));
    options.IdentityProviders.Add(idp);
});   

不确定我在这里缺少什么。感谢任何帮助。

【问题讨论】:

    标签: asp.net-mvc logout identityserver4 sustainsys-saml2


    【解决方案1】:

    检查您的日志,它应该向您显示最终在本地注销的决策过程。要使联合注销起作用,需要做很多事情。你需要一个服务证书,你需要一些特殊的索赔。后者将在未来与 Sustainsys.Saml2/IdSrv4 的兼容版本中得到简化

    【讨论】:

    • 谢谢,是的,它缺少声明,因此它没有从外部提供商退出。但是,Saml2 期望签名的注销响应,而我收到未签名的注销响应,但它失败了。有任何开关可以将其关闭或以其他方式验证响应吗?
    猜你喜欢
    • 1970-01-01
    • 2017-06-10
    • 2013-06-07
    • 2021-07-11
    • 2013-05-01
    • 2014-09-16
    • 2019-11-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多