我有一个使用 Shibboleth SP(最新版本 - 2.4.2)进行 Shibbolized 的 Rails 应用程序。我将它与 Apache 2.2 一起使用。我的 IdP 是 MS AD FS 2.0 服务器。
一切似乎都运行良好 - 用户访问该站点,被重定向到 AD FS,获得身份验证,然后返回并登录该站点。
问题是一旦你这样做了,几乎不可能及时以不同的用户身份登录。您可以清除所有 cookie(我在 Mac 上使用 Safari 和 Chrome 尝试此操作)并重新启动浏览器,但如果我首先以 Alice 身份进行身份验证,然后尝试以 Carol 身份登录,我仍然会登录到应用程序作为爱丽丝。
shibd 在清除 cookie 后收到的 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 分钟?)我对它需要多长时间没有确切的了解。
我错过了什么?我应该追求哪些其他途径?