Spring Security SAML和ECP

时间:2014-10-02 20:10:48

标签: spring-saml

我有使用Spring Security SAML扩展(版本1.0)的java web应用程序,充当SP。此SP使用预先配置的元数据,并且它适用于基于浏览器的客户端。我现在正尝试添加ECP支持,并且已将以下内容添加到元数据bean中SP的扩展元数据bean中:

<property name="ecpEnabled" value="true"/>

我使用以下标题作为GET请求作为标题参数:

Accept: application/vnd.paos+xml
PAOS: ver='urn:liberty:paos:2003-08';'urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp'

我的网络应用会抛出此异常:

  

HTTP状态500 - org.opensaml.saml2.metadata.provider.MetadataProviderException:服务提供者没有可用于所选配置文件的断言使用者服务org.opensaml.saml2.metadata.impl.SPSSODescriptorImpl@7fe2dde8

     

......根本原因......

     

org.opensaml.saml2.metadata.provider.MetadataProviderException:服务提供者没有可用于所选配置文件的断言使用者服务org.opensaml.saml2.metadata.impl.SPSSODescriptorImpl@7fe2dde8       org.springframework.security.saml.websso.WebSSOProfileImpl.getAssertionConsumerService(WebSSOProfileImpl.java:205)       org.springframework.security.saml.websso.WebSSOProfileECPImpl.sendAuthenticationRequest(WebSSOProfileECPImpl.java:55)       org.springframework.security.saml.SAMLEntryPoint.initializeECP(SAMLEntryPoint.java:185).....

所以看起来它似乎正在尝试启动ECP流程,但我不明白为什么我会收到此异常。我遵循了Spring SAML文档,它在ECP部分没有提到任何相关内容。

1 个答案:

答案 0 :(得分:0)

确保您的SP元数据包含具有绑定urn:oasis:names:tc:SAML:2.0:bindings:PAOS的端点。

Spring SAML示例应用程序的元数据生成UI有一个包含它的复选框,或者使用属性MetadataGenerator将其添加到bindingSSO bean,例如:

<property name="bindingsSSO">
    <list>
        <value>post</value>
        <value>artifact</value>
        <value>paos</value>
    </list>
</property>