cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mulpuri, Krishna Sai" <KrishnaSai.Mulp...@in.pega.com>
Subject RE: Unable to add Nonce and Created Timestamp in WS-security Headers
Date Tue, 18 Mar 2014 11:07:29 GMT
Found the issue. Sorry to bother you :)


From: Mulpuri, Krishna Sai
Sent: Tuesday, March 18, 2014 3:31 PM
To: 'users@cxf.apache.org'
Subject: Unable to add Nonce and Created Timestamp in WS-security Headers

Hi Andrei,

I am having below code to set nonce and created timestamp in the ws-security headers.
..........
outProps.put(WSHandlerConstants.ADD_USERNAMETOKEN_NONCE, WSConstants.NONCE_LN);
outProps.put(WSHandlerConstants.ADD_USERNAMETOKEN_CREATED, WSConstants.CREATED_LN);
...........
client.getOutInterceptors().add(new WSS4JOutInterceptor(outProps));

getting an exception saying invalid key "addUsernameTokenNonce" when I try to run the code
Mar 18, 2014 3:26:11 PM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
WARNING: Interceptor for #{http://cxf.apache.org/jaxws/dispatch}Invoke has thrown exception,
unwinding now
org.apache.cxf.binding.soap.SoapFault: Security processing failed.
       at org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java:265)
       at org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java:134)
       at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
       at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:502)
       at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:411)
       at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:314)
       at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:267)
       at org.apache.cxf.endpoint.ClientImpl.invokeWrapped(ClientImpl.java:302)
       at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:401)
       at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:243)

Caused by: org.apache.wss4j.common.ext.WSSecurityException: WSHandler: illegal addUsernameTokenNonce
parameter
       at org.apache.wss4j.dom.handler.WSHandler.decodeBooleanConfigValue(WSHandler.java:877)
       at org.apache.wss4j.dom.handler.WSHandler.decodeUTParameter(WSHandler.java:499)
       at org.apache.wss4j.dom.handler.WSHandler.doSenderAction(WSHandler.java:125)
       at org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor.access$100(WSS4JOutInterceptor.java:52)
       at org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java:258)
       ... 66 more

I am not sure whether this is a configuration issue or a bug.
Is there any other way to configure this ?

Thanks
Sai


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message