spring-projects / spring-ws

Spring Web Services
https://spring.io/projects/spring-ws
Apache License 2.0
321 stars 312 forks source link

Wss4jSecurityInterceptor does not support separate password for signature #1430

Open dmitriizagurskii opened 2 months ago

dmitriizagurskii commented 2 months ago

The Wss4jSecurityInterceptor does not support setting a separate password for the signature. Currently, when configuring the interceptor with both UsernameToken and signature, it uses the same password for both (Wss4jSecurityInterceptor#setSecurementPassword), making it impossible to specify different passwords for the UsernameToken and the signature.

This limitation makes it difficult to implement security setups that require different credentials for username authentication and digital signatures.

Current workaround I found is to extend the Wss4jSecurityInterceptor and override the request data initialization by specifying the password callback handler. However, it seems logical to add a dedicated setSecurementSignaturePassword() method, as it is already possible to specify a separate user for the certificate alias - setSecurementSignatureUser.