You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by ashish <as...@gmail.com> on 2016/04/06 18:45:33 UTC

Re: Unable to verify signature with Apache CXF and WSS4J on Websphere Application Server 8.5

cxf newbie <ca...@...> writes:> 
> 
> Sorry, you were right:
> 
> I put this in client class:
> Map<String, Object> ctx = ((BindingProvider)port).getRequestContext();
> ctx.put(WSHandlerConstants.IS_BSP_COMPLIANT, "false");
> 
> Now it works, but without timestamp reference.
> Interesting, <Body> is correctly signed and validated.
> 
> If I put <sp:IncludeTimestamp> in policy file:
> <wsu:Timestamp wsu:Id="TS-5A28482C0A57755103139419734630013">
>             <wsu:Created>2014-03-07T13:02:26.300Z</wsu:Created>
>             <wsu:Expires>2014-03-07T13:07:26.300Z</wsu:Expires>
> </wsu:Timestamp>
> 
> then I get:
> Digest value: OMNbo25276XKjodI3T60RuR1nh8=
> Calculated digest value: olWImZ1Re/74QV8+56VdoWpwjcs=
> 
> DOMReferencer class:
> validationStatus = Arrays.equals(digestValue, calcDigestValue); 
> This one returns false.
> 
> Thanks.
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Unable-to-
verify-signature-with-Apache-CXF-and-WSS4J-on-Websphere-Application-Server-
8-5-tp5740358p5740957.html
> Sent from the cxf-user mailing list archive at Nabble.com.
> 
> 
Hi,
  I am facing same issue my stand alone program is working fine but when 
deploy in WAS 8.5.5 is failing with "An error occurred when verifying 
security for the message"
The difference I noticed in request is the
ec:InclusiveNamespaces has been added in CanonicalizationMethod and 
Transform tag has different value than stand alone program

StandAlone  (which is good):
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-
c14n#">
<ec:InclusiveNamespaces xmln s:ec="http://www.w3.org/2001/10/xml-exc-c14n#" 
PrefixList="soap"/>
</ds:CanonicalizationMethod>

<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" >
<ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" 
PrefixList="wsse soap"/>
</ds:Transform>

With WAS (which is failing)
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-
c14n#">
<ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" 
PrefixList="soap soapenc xsd xsi"/>
</ds:CanonicalizationMethod>

<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
<ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" 
PrefixList=""/>
</ds:Transform>


I tried to remove this by 
Map<String, Object> ctx = ((BindingProvider) port).getRequestContext();
ctx.put(WSHandlerConstants.IS_BSP_COMPLIANT, "false");

but no luck. I am using WAS8.5.5 and CXF 3.1.5. 
If you pass through with this error Please help me.

Thanks