User login

WS-Security implementation

Forums :

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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

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.

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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.