WS-Security implementation

krishysr's picture
Hi I was able to expose web services using WSF/Spring. Can some help me on how to configure WS-Security to implement authentication and authorization. Thanks krish
sanjayak's picture

This requires policy support

This requires policy support which is still WIP. Soon we will add this to the trunk with the sample code updated.
sanka's picture

Hi Kris, You can enable

Hi Kris, You can enable WS-Security for a Spring Web service if you build the WSF-spring binaries from the latest codebase. Follow the steps given below. 1) Build the wsf-spring binaries from the latest codebase. 2) Add rampart mar / jar files to the lib folder of the servlet container. 3) Specify the security policy for the service in applicationContext.xml <bean id="sampleservice" class="org.wso2.spring.ws.SpringWebService">           ....     <property name="policies">     <list>               <value>                 <!-- service security policy as the String --> &lt;wsp:Policy wsu:Id="SgnEncrAnonymous" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&gt;                &lt;wsp:ExactlyOne&gt;                   &lt;wsp:All&gt;                        ....                 </value>         </list>    </property>    .... </bean> 4) Engage rampart module by adding the following entry in applicationContext.xml <bean id="sampleservice" .. >     ....     <property name="modules">         <list>             <value>addressing</value>         </list>     </property>     .... </bean> HTH Sanka
skarootz's picture

about policy.xml

Hi, I want to be able to include the passwordCallBack handler using spring di instead of the policy.xml file, is that posible, I need this because my passwordCallbackHandler uses another dependencies that are managed by Spring. Here is an example, the " does it really work" is an attempt to do it. <bean id="services" class="org.wso2.spring.ws.WebServices">         <property name="services">             <list>                 <bean id="emrService" class="org.wso2.spring.ws.SpringWebService">                     <property name="serviceBean" ref="emrws"></property>                     <property name="serviceName" value="emrWs"></property>                     <property name="serviceDescription"                         value="Provee de metodos para realizar busquedas."></property>                     <property name="modules">                         <list>                             <value>rampart</value>                         </list>                     </property>                     <property name="policyFiles">                         <list>                             <value>policy.xml</value>                         </list>                     </property> <!-- does it really work   http://wso2.org/forum/thread/3486#comment-10564  -->                     <property name="parameters">                         <map>                             <entry key="InflowSecurity" value-ref="inflowConfiguration" /> <!--                            <entry key="OutflowSecurity" value-ref="outflowConfiguration" />-->                         </map>                     </property> <!-- /does it really work -->                 </bean>             </list>         </property>     </bean>
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)