throw new LoginException("Cannot extract credentials from class: " + credentials.getClass().getName());
}
//set up the login context
LoginContext loginContext = ContextManager.login(configurationFactory.getConfigurationName(), callbackHandler, configurationFactory.getConfiguration());
callbackHandler.clear();
Subject subject = loginContext.getSubject();
ContextManager.setCallers(subject, subject);
//login success