Description
The UsernameTokenProcessor class logs the username and password to the log file.
org.apache.ws.security.processor.UsernameTokenProcessor file from TRUNK:
public WSUsernameTokenPrincipal handleUsernameToken(Element token, CallbackHandler cb)
88 throws WSSecurityException {
89 if (cb == null)
92 //
93 // Parse the UsernameToken element
94 //
95 ut = new UsernameToken(token, allowNamespaceQualifiedPasswordTypes);
96 ut.setPasswordsAreEncoded(passwordsAreEncoded);
97 String user = ut.getName();
98 String password = ut.getPassword();
99 String nonce = ut.getNonce();
100 String createdTime = ut.getCreated();
101 String pwType = ut.getPasswordType();
102 if (log.isDebugEnabled())
I think from a security stand point it is wrong to log the password.
In production environments for instance I want to log the username, but can't do that without logging the password as well.
I say either remove the password from logging or add a
log.info("UsernameToken user " + user); -> At INFO level
Thanks.