2013-11-22 72 views
2

我正在嘗試使用cxf SamlRedirectBindingFilter來保護使用SAML Web SSO在駱駝中定義的CXFRS消費者端點。下面的Spring XML定義路線/端點:使用SAML保護駱駝CXFRS消費者

<cxf:bus> 
    <cxf:features> 
     <cxf:logging/> 
    </cxf:features> 
</cxf:bus> 

<bean id="stateManager" class="org.apache.cxf.rs.security.saml.sso.state.EHCacheSPStateManager"> 
    <constructor-arg ref="cxf"/> 
</bean> 

<bean id="redirectGetFilter" class="org.apache.cxf.rs.security.saml.sso.SamlRedirectBindingFilter"> 
    <property name="idpServiceAddress" value="http://carnold-linux.ptcnet.ptc.com:9093/idp/profile/SAML2/Redirect/SSO"/> 
    <property name="assertionConsumerServiceAddress" value="/racs/sso"/> 
    <property name="stateProvider" ref="stateManager"/> 
    <property name="addWebAppContext" value="false"/> 
</bean> 

<camelContext id="camel" trace="false" xmlns="http://camel.apache.org/schema/spring"> 
    <route id="proxyRoute"> 
     <from uri="cxfrs://http://0.0.0.0:9092/app?resourceClasses=com.company.FooResource,com.company.BarResource&amp;providers=#redirectGetFilter"/> 
    ...rest of route 

我遇到的問題是,即使我添加了SamlRedirectFilter到供應商的終點 - 這不是重定向/認證。任何想法可能是什麼問題?

回答

1

當前駱駝版本不支持從uri配置提供。 rsServer就這樣

<cxf:rsServer id="rsServer" address="http://0.0.0.0:9092/app" 
    > 
    <cxf:providers> 
     <ref bean="redirectGetFilter"/> 
    </cxf:providers> 
    <cxf:serviceBeans> 
     <ref bean="fooResource"/> 
     <ref bean="barResource"/> 
    </cxf:serviceBeans> 
</cxf:rsServer> 

<bean id="fooResource" class="com.company.FooResource"/> 
<bean id="barResource" class="com.company.BarResource"/> 

<camelContext id="camel" trace="false" xmlns="http://camel.apache.org/schema/spring"> 
    <route id="proxyRoute"> 
     <from uri="cxfrs://bean:rsServer"/> 
    ...rest of route 

您可以通過使用CXF配置提供