final String username = usernameResult.getStringValue();
final SecurityManager sm = broker.getBrokerPool().getSecurityManager();
Subject user;
try {
user = sm.authenticate(username, password.getStringValue());
} catch(final AuthenticationException e) {
final XPathException exception = new XPathException(this, "Authentication failed", e);
logger.error("Authentication failed for [" + username + "] because of [" + e.getMessage() + "].", exception);
throw exception;
}