我正在尝试使用cxf SamlRedirectBindingFilter来保护使用SAML Web SSO在camel中定义的CXFRS使用者端点。下面是定义路由/端点的spring XML:
<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&providers=#redirectGetFilter"/>
...rest of route
我遇到的问题是即使我将SamlRedirectFilter添加到端点的提供程序 - 它也没有重定向/验证。关于可能出现什么问题的任何想法?
答案 0 :(得分:1)
当前的camel发行版不支持从uri配置提供。
您可以像使用cxf: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