Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

It's recommended to use Maven to resolve the dependencies as illustrated in the the example wsclientWebapp.

Code Block
xmlxml
titlepom.xml
borderStylesolid
xml
    <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.

xml
Code Block
xml
titleweb.xml
borderStylesolid
xml
    <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.

xml
Code Block
xml
titleapplicationContext.xml
borderStylesolid
xml
    <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>

...