}
//set up the login context
LoginContext loginContext = new LoginContext(securityRealmName, callbackHandler);
loginContext.login();
callbackHandler.clear();
Subject subject = ContextManager.getServerSideSubject(loginContext.getSubject());
//TODO use the run-as subject as nextCaller
ContextManager.setCallers(subject, subject);
ContextManager.setNextCaller(subject);