- if (subject != null) {
- returnCode = (Integer) Subject.doAs(subject,
- getRunAction(display));
- SecureApplicationActivator.getLoginContext().logout();
- return processReturnCode(returnCode);
- } else {
- return -1;
+ // identify after successful login
+ if (log.isDebugEnabled())
+ log.debug("subject=" + subject);
+ final String username = subject.getPrincipals().iterator().next()
+ .getName();
+ if (log.isDebugEnabled())
+ log.debug(username + " logged in");
+ display.disposeExec(new Runnable() {
+ public void run() {
+ log.debug("Display disposed");
+ logout(loginContext, username);