AccountDAO accountDAO =
ServiceLocator.instance().getInstance(AccountDAO.class);
ZanataJpaIdentityStore idStore =
ServiceLocator.instance().getInstance(
ZanataJpaIdentityStore.class);
AuthenticationEvents authEvts =
ServiceLocator.instance().getInstance(
AuthenticationEvents.class);
HAccount authenticatedAccount = accountDAO.getByUsername(username);
idStore.setAuthenticateUser(authenticatedAccount);
}