use of org.apache.wss4j.dom.message.token.UsernameToken in project wildfly by wildfly.
the class UsernameTokenCallbackHandler method createWSSEUsernameToken.
private UsernameToken createWSSEUsernameToken(String username, String password, Document doc) {
UsernameToken usernameToken = new UsernameToken(true, doc, (password == null) ? null : WSConstants.PASSWORD_TEXT);
usernameToken.setName(username);
usernameToken.addWSUNamespace();
usernameToken.addWSSENamespace();
usernameToken.setID("id-" + username);
if (password != null) {
usernameToken.setPassword(password);
}
return usernameToken;
}
Aggregations