You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by Shlomi Aflalo <sh...@exelate.com> on 2008/05/26 14:46:27 UTC

problems with Rampart security policy

Hello,
I'm trying to write a web-service which will use a security policy to
force signing the message and sending additional supporting username
token.
For testing the security policy I used Rampart's policy sample no.2 as
a basis and altered it according to my needs.

When I deploy the service and test it with a client, I get this error:
Exception in thread "main" org.apache.axis2.AxisFault: An error was
discovered processing the <wsse:Security> header. (Reference URI is
null)
    at org.apache.axis2.util.Utils
.getInboundFaultFromMessageContext(Utils.java:486)
    at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
    at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)
    at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:508)
    at org.apache.rampart.samples.policy.sample02.Client.main(Unknown Source)

can someone please help? Am I doing something wrong?
(with the sample's original security policy, it's working ok, the
problem starts only when I use my altered version)

this is the security policy I use:


          <wsp:Policy wsu:Id="SigOnly"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
                   <wsp:ExactlyOne>
                             <wsp:All>
                                      <sp:SymmetricBinding
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                                                <wsp:Policy>
                                                          <sp:AlgorithmSuite>
                                                                   <wsp:Policy>

      <sp:Basic256/>
                                                                   </wsp:Policy>
                                                          </sp:AlgorithmSuite>
                                                          <sp:Layout>
                                                                   <wsp:Policy>

      <sp:Lax/>
                                                                   </wsp:Policy>
                                                          </sp:Layout>
                                                          <sp:IncludeTimestamp/>
                                                          <sp:ProtectionToken>
                                                                   <wsp:Policy>

      <sp:X509Token
sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">

               <wsp:Policy>

                         <sp:WssX509V3Token10/>

               </wsp:Policy>

      </sp:X509Token>
                                                                   </wsp:Policy>
                                                          </sp:ProtectionToken>

<sp:SignedSupportingTokens>
                                                                   <wsp:Policy>

      <sp:UsernameToken/>
                                                                   </wsp:Policy>

</sp:SignedSupportingTokens>
                                                </wsp:Policy>
                                      </sp:SymmetricBinding>
                                      <sp:SignedParts
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                                                <sp:Body/>
                                      </sp:SignedParts>

                                      <ramp:RampartConfig
xmlns:ramp="http://ws.apache.org/rampart/policy">
                                                <ramp:user>service</ramp:user>

<ramp:encryptionUser>client</ramp:encryptionUser>

<ramp:passwordCallbackClass>org.apache.rampart.samples.policy.sample02.PWCBHandler</ramp:passwordCallbackClass>

                                                <ramp:signatureCrypto>
                                                          <ramp:crypto
provider="org.apache.ws.security.components.crypto.Merlin">

<ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>

<ramp:property name="org.apache.ws.security.crypto.merlin.file">service.jks</ramp:property>

<ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">apache</ramp:property>
                                                          </ramp:crypto>
                                                </ramp:signatureCrypto>
                                      </ramp:RampartConfig>

                             </wsp:All>
                   </wsp:ExactlyOne>
          </wsp:Policy>

I will appreciate any possible help…

Thanks!

Shlomi.