cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrei Shakirin <ashaki...@talend.com>
Subject RE: customizing WSSConfig properties (other than the action map) using spring configuration
Date Mon, 22 Apr 2013 08:12:58 GMT
Hi David,

It seems there is no easy way to do it now. Only a solution I see is to overload handleMessage()
method of WSS4JOutInterceptor and copy&paste CXF code.
I think we can provide a message contextual property to use preconfigured WSSConfig:

                    WSSConfig config  = 
                        message.getContextualProperty(SecurityConstants.WSS_CONFIG);
                    if (config != null) {
                        config = WSSConfig.getNewInstance();
                    }
Patch is welcome.

@Colm: do you see more elegant solution of this?

Regards,
Andrei.

> -----Original Message-----
> From: David Mansfield [mailto:cxf@dm.cobite.com]
> Sent: Sonntag, 21. April 2013 22:42
> To: users@cxf.apache.org
> Subject: customizing WSSConfig properties (other than the action map) using
> spring configuration
> 
> Hi All:
> 
> I've finally hacked together a configuration of the STSClient that works with
> our partner's almost-compliant implementation.
> 
> I'm trying to make it "reasonable" now, and one thing I'm stuck on is how to
> change WSSConfig values.
> 
> In particular, I have had to replace the UsernameTokenSignedAction because
> I need to add:
> 
>        reqData.getWssConfig().setPrecisionInMilliSeconds(false);
> 
> (I need to turn off milliseconds, because I'm using the code which generates
> a secret key from a UsernameToken for signing, and the partner's key is
> generated with a wsu:Created that does not include milliseconds in the
> timestamp value, see:
> org.apache.ws.security.message.token.UsernameToken.java:684)
> 
> Unlike the dozens of other things I have tweaked by setting properties on
> the bus/client, the values in the WSSConfig seem to be buried quite deep in
> the implementation.
> 
> It looks like the WSSConfig instance gets created with defaults at
> WSS4JOutInterceptor.java:177, and there is no way to override the defaults,
> and no way to apply properties to the created WSSConfig object.
> 
> Is there a spring-y or other programmatic way to configure this that I have
> missed?
> 
> --
> Thanks,
> David Mansfield
> Cobite, INC.


Mime
View raw message