Integration with Rampart

stlecho's picture

Hi,

I would like to enable Rampart for my Spring-based webservices. Could you explain me the different steps required (definition of signing policy, ...) for wsf-spring to enforce this integration ?

Regards, Stefan Lecho.

benugu's picture

Rampart configuration

I have also been trying to engage Rampart for web service exposed using wsf-spring. Since i could not find any concrete documentation for Rampart integration, I tried adding rampart module and security phase to axis2Confog.xml (abstract below..). - added rampart module <property name="modules">     <list>          <value>addressing</value>          <value>rampart</value>     </list> </property>   - added handlers for the security phase <!-- Security phase definition -->     <bean id="axis2SecurityPhase" class="org.wso2.spring.ws.beans.PhaseBean">         <property name="name" value="Security"/>         <property name="handlers">              <list>                 <ref bean="securityInHandler"/>                 <ref bean="securityOutHandler"/>             </list>         </property>     </bean> <!-- Security In handler -->     <bean id="securityInHandler" class="org.wso2.spring.ws.beans.HandlerBean">         <property name="name" value="SecurityInHandler"/>         <property name="clazz" value="org.apache.rampart.handler.WSDoAllReceiver"/>         <property name="orderPhase" value="Security"/>     </bean> <!-- Security Out handler -->     <bean id="securityOutHandler" class="org.wso2.spring.ws.beans.HandlerBean">         <property name="name" value="SecurityOutHandler"/>         <property name="clazz" value="org.apache.rampart.handler.WSDoAllSender"/>         <property name="orderPhase" value="Security"/>     </bean>   - added the following bean ref to axis2InPhaseOrder, axis2InFaultPhaseOrder, axis2OutPhaseOrder and axis2OutFaultPhaseOrder <ref bean="axis2SecurityPhase"/>   My spring context  had the following configuration: <beans>     <import resource="axis2Config.xml"/>     <bean id="pmsDatabaseService" class="com.service.PMSDatabaseServiceImpl">         <property name="pmsDao" ref="pmsDao"/>     </bean>     <bean id="services" class="org.wso2.spring.ws.WebServices">          <property name="services">              <list>                  <bean id="PMSDatabase" class="org.wso2.spring.ws.SpringWebService">                       <property name="serviceBean" ref="pmsDatabaseService"/>                       <property name="serviceName" value="PMSDatabase"/>                       <property name="serviceDescription" value="Service for PMS database update"/>                       <property name="modules">                           <list>                                <value>addressing</value>                                <value>rampart</value>                          </list>                      </property>                      <property name="parameters">                            <map>                                     <entry key="InflowSecurity" value-ref="inflowConfiguration"/>                                     <entry key="OutflowSecurity" value-ref="outflowConfiguration"/>                            </map>                     </property>                </bean>             </list>         </property>     </bean>     <bean id="inflowConfiguration" class="org.apache.rampart.handler.config.InflowConfiguration">           <property name="actionItems" value="UsernameToken"/>           <property name="passwordCallbackClass" value="com.security.PWCBHandler"/>     </bean>     <bean id="outflowConfiguration" class="org.apache.rampart.handler.config.OutflowConfiguration">          <property name="actionItems" value="UsernameToken"/>          <property name="user" value="pmsUser"/>          <property name="passwordCallbackClass" value="com.security.PWCBHandler"/>     </bean> </beans>   I also enagaged Rampart and addressing module at the client side (stub generated by axis2) following sample 11 from the Rampart distribution. When the web service was invoked, the SOAP request had all the relevant security headers but the SOAP response had 'Configuration error' returned as axis fault. After further investigation, I found that the error was coming from rampart code while reading the parameters from service configuration (ParameterElement was null). So I was not sure if the security configuration I did for the web service in spring context was right. Any help will be greatly appreciated. Thanks, Benu
krishysr's picture

Hi I have a similar

Hi I have a similar requirement. Could you please share your configuration and code. I need to implement ws-security with WSF/Spring. I am not able to find any documentation. Thanks Krish
sanjayak's picture

http://wso2.org/forum/thread/

http://wso2.org/forum/thread/3843
skarootz's picture

engaging rampart passwordCallbackClass from applicationContext

Hi this is exactly what I'm looking for, a way to specify the class I will use for passwordCallBack handler using a spring bean instead from policy.xml, because my passwordCallBack need other dependencies and I want to inject them using Spring, we'll I'll try with Did you get it working???
library project main code
Learn Cloud
Learn
Cloud

The WSO2 Application Server is a reliable application server that can host your enterprise web applications. The WSO2 Application Server as a Service is offered in StratosLive, the WSO2 Platform as a Service. This article explains how a simple web application can be developed and deployed from Carbon Studio to the WSO2 Application Server...

Latest Webinar
Different groups within an organization need to monitor different Key Performance Indicators (KPIs) - An operations team will be interested in the response times of business services and loads of each service,..
Thursday, February 9th 2012, 09.00 AM (PST)

Thursday, February 9th 2012, 10.00 AM (GMT)