ASP.NET中的ADFS 2.0 / SAML令牌是粘性的吗?

时间:2016-07-25 11:05:59

标签: asp.net authentication saml adfs identityserver3

我们正在运行带有ADFS 2.0的ASP.NET 4.6应用程序。 web.config ADFS部件的配置是通过FedUtil.exe创建的。

我们现在遇到的问题是,Web应用程序的第二个实例仍然认为用户未经过身份验证。

    服务器1上的
  • auth仅适用于服务器1
  • 服务器2上的
  • auth仅适用于服务器2

,但..

    服务器1上的
  • auth无法在服务器2上识别,反之亦然

在我们的场景中,只有粘性会话才能在负载平衡环境中运行。我认为这是因为需要SessionModule:

    <modules>
        <add name="WSFederationAuthenticationModule" type="Microsoft.IdentityModel.Web.WSFederationAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler" />
        <add name="SessionAuthenticationModule" type="Microsoft.IdentityModel.Web.SessionAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler" />
    </modules>

我是否正确,SessionModule将auth *的任何数据存储到会话中,因此无法进行共享会话,我们被迫使用粘性会话?

IdentityServer3或IdentityServer4会解决此问题吗?

1 个答案:

答案 0 :(得分:0)

似乎Microsoft.Identity没有提供没有Sticky Sessions的SAML令牌:https://leastprivilege.com/2012/07/12/machinekey-based-session-protection-for-wif/