}
LoginContext loginContext = null;
try {
CallbackHandler handler =
new UsernamePasswordCallbackHandler(username, password);
loginContext = new LoginContext(jaasConfigName, handler);
loginContext.login();
} catch (LoginException le) {
logger.error(le.toString());
return null;