我使用spring-security-saml2-core(1.0.0.RC2)通过SAML使用ADFS 2.0。我使用HTTP-POST绑定。但我有SingleLogout的问题。
应用程序接收LogoutRequest
<samlp:LogoutRequest
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified"
Destination="https://myhost:8443/my/saml/SingleLogout/alias/defaultAlias"
ID="_438dcef8-cd64-4e04-8e11-e87705f26b6c"
IssueInstant="2014-08-01T10:53:14.641Z"
NotOnOrAfter="2014-08-01T10:58:14.641Z"
Version="2.0">
<Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">https://adfs-server.local/adfs/services/trust</Issuer>
<NameID xmlns="urn:oasis:names:tc:SAML:2.0:assertion">nata</NameID>
<samlp:SessionIndex>_34e48828-a6b5-47c2-96fd-595f9d0a88b7</samlp:SessionIndex>
</samlp:LogoutRequest>
并发送LogoutResponse
<saml2p:LogoutResponse
xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol"
Destination="https://adfs-server.local/adfs/ls/"
ID="a2ddb014h7d7558f3cd5hfge981bicf"
InResponseTo="_438dcef8-cd64-4e04-8e11-e87705f26b6c"
IssueInstant="2014-08-01T10:53:43.808Z"
Version="2.0">
<saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">https://myhost:8443/my/saml/metadata/alias/defaultAlias</saml2:Issuer>
<saml2p:Status>
<saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
</saml2p:Status>
</saml2p:LogoutResponse>
但ADFS抛出关闭SAML端点的错误:
MSIS7074:WebSSO配置文件的SAML身份验证请求必须指定没有NameQualifier,SPNameQualifier或SPProvidedId属性的颁发者。
我对SingleLogout的配置:
<bean id="samlFilter" class="org.springframework.security.web.FilterChainProxy">
<security:filter-chain-map request-matcher="ant">
<security:filter-chain pattern="/saml/login/**" filters="samlEntryPoint"/>
<security:filter-chain pattern="/saml/logout/**" filters="samlLogoutFilter"/>
<security:filter-chain pattern="/saml/metadata/**" filters="metadataDisplayFilter"/>
<security:filter-chain pattern="/saml/SSO/**" filters="samlWebSSOProcessingFilter"/>
<security:filter-chain pattern="/saml/SingleLogout/**" filters="samlLogoutProcessingFilter"/>
</security:filter-chain-map>
</bean>
<!-- Filter processing incoming logout messages -->
<!-- First argument determines URL user will be redirected to after successful global logout -->
<bean id="samlLogoutProcessingFilter" class="org.springframework.security.saml.SAMLLogoutProcessingFilter">
<constructor-arg type="org.springframework.security.web.authentication.logout.LogoutSuccessHandler" ref="successLogoutHandler"/>
<constructor-arg>
<array value-type="org.springframework.security.web.authentication.logout.LogoutHandler">
<ref bean="logoutHandler"/>
</array>
</constructor-arg>
</bean>
<bean id="successLogoutHandler" class="org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler">
<property name="defaultTargetUrl" value="/"/>
</bean>
<!-- Logout handler terminating local session -->
<bean id="logoutHandler" class="org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler">
<property name="invalidateHttpSession" value="false"/>
</bean>
答案 0 :(得分:1)
:-)哎这令人困惑.....并且交叉发帖??
首先:我的ADFS服务器2.x,在S2008(R2)和S2012上没有该消息。所以我相信它不能是ADFS 2.0。我假设您正在使用Windows Server 2012R2上的ADFS服务器(从未将其标识为2.0)。 : - (
消息(关于AuthnRequest与LogoutResponse)似乎完全不合适。看起来你在S2012R2上遇到了ADFS的一个小问题(超级混乱)。因为在这种情况下ADFS 2.0会说些别的东西。它会说[在ValidateSignatureRequirements(SamlMessage)方法中]: “MSIS1014:使用SAML HTTP重定向或HTTP POST绑定时,必须对SAML LogoutRequest和LogoutResponse消息进行签名。”
所以你有一个错误要在Microsoft提交(对此描述的引用可以帮助你)。同时你应该要求SP签署LogoutResponse。我有点惊讶ADFS没有签署LogoutRequest。它通常会签署LogoutRequest。
答案 1 :(得分:0)
必须签署SAML LogoutRequest消息。错误是固定的。我们在ExtendedMetadata中将参数requireLogoutResponseSigned设置为''true“。
<bean class="org.springframework.security.saml.metadata.ExtendedMetadata">
<property name="local" value="false" />
<property name="idpDiscoveryEnabled" value="false" />
<property name="requireLogoutResponseSigned" value="true"/>
</bean>