@Override public boolean logout() throws LoginException { subject.getPrincipals().removeAll(principals); clear(); if (debug) { LOG.debug("logout"); } succeeded = false; commitSucceeded = false; return true; }
@Override public boolean abort() throws LoginException { if (debug) { LOG.debug("abort"); } if (!succeeded) { return false; } else if (succeeded && commitSucceeded) { // we succeeded, but another required module failed logout(); } else { // our commit failed clear(); succeeded = false; } return true; }
@Override public boolean commit() throws LoginException { if (!succeeded) { clear(); if (debug) { LOG.debug("commit, result: false"); } return false; } principals.add(new UserPrincipal(user)); Set<String> matchedGroups = groups.get(user); if (matchedGroups != null) { for (String entry : matchedGroups) { principals.add(new GroupPrincipal(entry)); } } subject.getPrincipals().addAll(principals); if (debug) { LOG.debug("commit, result: true"); } commitSucceeded = true; return true; }
@Override public boolean abort() throws LoginException { clear(); if (debug) { LOG.debug("abort"); } return true; }
@Override public boolean abort() throws LoginException { clear(); if (debug) { LOG.debug("abort"); } return true; }
@Override public boolean logout() throws LoginException { subject.getPrincipals().removeAll(principals); principals.clear(); clear(); if (debug) { LOG.debug("logout"); } return true; }
@Override public boolean logout() throws LoginException { subject.getPrincipals().removeAll(principals); principals.clear(); clear(); if (debug) { LOG.debug("logout"); } return true; }
@Override public boolean commit() throws LoginException { boolean result = loginSucceeded; if (result) { principals.add(new UserPrincipal(user)); Set<String> matchedGroups = groups.get(user); if (matchedGroups != null) { for (String entry : matchedGroups) { principals.add(new GroupPrincipal(entry)); } } subject.getPrincipals().addAll(principals); } // will whack loginSucceeded clear(); if (debug) { LOG.debug("commit, result: " + result); } return result; }
@Override public boolean commit() throws LoginException { boolean result = loginSucceeded; if (result) { principals.add(new UserPrincipal(user)); Set<String> matchedGroups = groups.get(user); if (matchedGroups != null) { for (String entry : matchedGroups) { principals.add(new GroupPrincipal(entry)); } } subject.getPrincipals().addAll(principals); } // will whack loginSucceeded clear(); if (debug) { LOG.debug("commit, result: " + result); } return result; }