secAdapterfactory = spiProvider.getSPI(SecurityAdaptorFactory.class);
}
public void process(Document message, Token token) throws WSSecurityException
{
UsernameToken user = (UsernameToken)token;
SecurityAdaptor securityAdaptor = secAdapterfactory.newSecurityAdapter();
Logger.getLogger(this.getClass()).info("Username: " + user.getUsername());
Logger.getLogger(this.getClass()).info("Password: " + user.getPassword());
if (user.isDigest())
{
verifyUsernameToken(user);
CallbackHandler handler = new UsernameTokenCallbackHandler(user.getNonce(), user.getCreated());
CallbackHandlerPolicyContextHandler.setCallbackHandler(handler);
}
securityAdaptor.setPrincipal(new SimplePrincipal(user.getUsername()));
securityAdaptor.setCredential(user.getPassword());
}