Identity ids = Identity.instance();
ids.getCredentials().setUsername(usr);
ids.getCredentials().setPassword(pwd);
try {
ids.authenticate();
} catch (LoginException e) {
throw new ServletException(new IllegalArgumentException("Unable to authenticate user."));
}
log.debug("Successful login");