Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ws-security.username

The username used for UsernameToken policy assertions

ws-security.password

The password used for UsernameToken policy assertions. If not specified, the callback handler will be called.

ws-security.callback-handler

The WSS4J security CallbackHandler that will be used to retrieve passwords for keystores and UsernameTokens.

ws-security.signature.properties

The properties file/object that contains the WSS4J properties for configuring the signature keystore and crypto objects

ws-security.encryption.properties

The properties file/object that contains the WSS4J properties for configuring the encryption keystore and crypto objects

ws-security.signature.username

The username or alias for the key in the signature keystore that will be used. If not specified, it uses the the default alias set in the properties file. If that's also not set, and the keystore only contains a single key, that key will be used.

ws-security.encryption.username

The username or alias for the key in the encryption keystore that will be used. If not specified, it uses the the default alias set in the properties file. If that's also not set, and the keystore only contains a single key, that key will be used.

ws-security.signature.crypto

Instead of specifying the signature properties, this can point to the full WSS4J Crypto object. This can allow easier "programmatic" configuration of the Crypto information."

ws-security.encryption.crypto

Instead of specifying the encryption properties, this can point to the full WSS4J Crypto object. This can allow easier "programmatic" configuration of the Crypto information."

Note: for Symmetric bindings that specify a protection token, the ws-security-encryption properties are used.

Configuring via spring

The properties are easily configured as client or endpoint properties:

Code Block
xml
xml

<jaxws:client name="{http://cxf.apache.org}MyService" createdFromAPI="true">
    <jaxws:properties>
        <entry key="ws-security.username" value="Alice"/>
        <entry key="ws-security.callback-handler" value="interop.client.KeystorePasswordCallback"/>
        <entry key="ws-security.signature.properties" value="etc/alice.properties"/>
        <entry key="ws-security.encryption.properties" value="etc/bob.properties"/>
    </jaxws:properties>
</jaxws:client>
Code Block
xml
xml

<jaxws:endpoint 
   id="MyService"
   address="https://localhost:9001/MyService" 
   serviceName="interop:MyService"
   endpointName="interop:MyServiceEndpoint"
   implementor="com.foo.MyService">
        
   <jaxws:properties>
       <entry key="ws-security.username" value="Alice"/>
       <entry key="ws-security.callback-handler" value="interop.client.UTPasswordCallback"/>
   </jaxws:properties> 
     
</jaxws:endpoint> 

Configuring via API's

Configuring the properties for the client just involves setting the properties in the clients RequestContext:

Code Block
java
java

Map<String, Object> ctx = ((BindingProvider)port).getRequestContext();
ctx.put("ws-security.ws-security.encryption.properties", properties);
port.echoString("hello");