/** * Overriding to complete login process. Standard JAAS. */ @Override public boolean commit() throws LoginException { principals.add(new UserPrincipal(username)); for (String role : getUserRoles(username)) { principals.add(new RolePrincipal(role)); } subject.getPrincipals().addAll(principals); clear(); if (debug) { logger.debug("commit"); } return true; }