THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
It's recommended to use Maven to resolve the dependencies as illustrated in the the example wsclientWebapp
.
Code Block | |||||||||
---|---|---|---|---|---|---|---|---|---|
| |||||||||
<dependency> <groupId>org.apache.cxf.fediz</groupId> <artifactId>fediz-cxf</artifactId> <version>1.1.0</version> </dependency> |
...
Two configurations are required in web.xml
to enable the FederationFilter
to cache the security context in the thread local storage and in the spring configuration file applicationContext.xml
to configure a callback handler to provide the STS client the security context stored in the thread local storage.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<filter> <filter-name>FederationFilter</filter-name> <filter-class>org.apache.cxf.fediz.core.servlet.FederationFilter</filter-class> </filter> <filter-mapping> <filter-name>FederationFilter</filter-name> <url-pattern>/secure/*</url-pattern> </filter-mapping> |
The FederationFilter
is part of the library fediz-core
.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<bean id="delegationCallbackHandler" class="org.apache.cxf.fediz.cxf.web.ThreadLocalCallbackHandler" /> <jaxws:client id="HelloServiceClient" serviceName="svc:GreeterService" ... wsdlLocation="WEB-INF/wsdl/hello_world.wsdl"> <jaxws:properties> <entry key="ws-security.sts.client"> <bean class="org.apache.cxf.ws.security.trust.STSClient"> ... <property name="onBehalfOf" ref="delegationCallbackHandler" /> ... </bean> </entry> <entry key="ws-security.cache.issued.token.in.endpoint" value="false" /> </jaxws:properties> </jaxws:client> |
...