public Object login(String user, String pass) throws LoginException {
return login("OpenEJB", user, pass);
}
public Object login(String securityRealm, String user, String pass) throws LoginException {
LoginContext context = ContextManager.login(securityRealm, new UsernamePasswordCallbackHandler(user, pass));
Subject subject = context.getSubject();
return ContextManager.getSubjectId(subject);
}