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 = new LoginContext(securityRealm, new UsernamePasswordCallbackHandler(user, pass));
context.login();
Subject subject = context.getSubject();
SubjectId subjectId = ContextManager.registerSubject(subject);
return subjectId;