Shibboleth SP将错误的用户身份传递给应用程序

时间:2011-05-19 21:50:36

标签: saml adfs2.0 shibboleth

我有一个Rails应用程序,我使用Shibboleth SP进行了Shibbolized(最新版本 - 2.4.2)。我在Apache 2.2中使用它。我的IdP是MS AD FS 2.0服务器。

一切似乎运作良好 - 用户访问网站,重定向到AD FS,获得身份验证,然后返回并登录到网站。

问题是,一旦你完成了这项工作,几乎不可能及时以不同的用户身份登录。您可以清除所有Cookie(我在Mac上使用Safari和Chrome进行尝试)并重新启动浏览器,但如果我首先通过身份验证为Alice,然后尝试以Carol身份登录,我仍然会登录到应用程序作为爱丽丝。

清除cookie后,shibd收到的SAML响应中包含正确的身份:

<AttributeStatement>
  <Attribute Name="http://schemas.xmlsoap.org/claims/CommonName">
    <AttributeValue>Carol</AttributeValue>
  </Attribute>
  <Attribute Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress">
    <AttributeValue>carol@dev.REDACTED.com</AttributeValue>
  </Attribute>
  <Attribute Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn">
    <AttributeValue>carol@dev.REDACTED.com</AttributeValue>
  </Attribute>
</AttributeStatement>

但是当Shibboleth SP将环境变量传递给我的应用程序时,它会发送错误的凭据:

[DEBUG 05/19 16:30:09]   ENV:  Shib-Session-ID => _615014991ed1b7dcc43f647ceb1f4944
[DEBUG 05/19 16:30:09]   ENV:  Shib-Identity-Provider => http://REDACTED/adfs/services/trust
[DEBUG 05/19 16:30:09]   ENV:  Shib-Authentication-Instant => 2011-05-19T21:17:23.861Z
[DEBUG 05/19 16:30:09]   ENV:  Shib-Authentication-Method => urn:federation:authentication:windows
[DEBUG 05/19 16:30:09]   ENV:  Shib-AuthnContext-Class => urn:federation:authentication:windows
[DEBUG 05/19 16:30:09]   ENV:  Shib-Session-Index => _cadfb4e6-ffb2-45f9-aab5-6bce8c3bc17a
[DEBUG 05/19 16:30:09]   ENV:  cn => alice
[DEBUG 05/19 16:30:09]   ENV:  email => alice@dev.REDACTED.com
[DEBUG 05/19 16:30:09]   ENV:  principal => alice@dev.READACTED.com

尽管已经破解了所有cookie,但Shib-Session-ID将是相同的。不知何故,似乎是在关联两个交互并重新建立现有会话,而不是使用SAML响应中的帐户信息进行新会话。

我已经将我能找到的所有缓存超时值设置为60秒,但是在浏览器关闭的情况下等待2-3分钟并不足以让它进行新的会话。

<StorageService type="Memory" id="mem" cleanupInterval="60"/>
<SessionCache type="StorageService" StorageService="mem" cacheTimeout="60" 
   inprocTimeout="60" cleanupInterval="60" />

...

<Sessions lifetime="60" timeout="60" checkAddress="false" relayState="ss:mem"
    handlerSSL="false">

重新启动apache和shibd是有效的,关闭浏览器并让它静置很长时间(10-15分钟?)我还没有确切知道需要多长时间。

我错过了什么?我应该采取哪些其他途径?

1 个答案:

答案 0 :(得分:1)

关键是我们的应用程序是使用Passenger部署的Rails应用程序。看起来Passenger在第一次调用后没有更新环境变量,所以你可能最终得到旧数据。

切换到通过标题传递用户信息(ShibUseHeaders on)解决了问题。

相关问题