Fix issue with display name.
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / auth / NodeUserLoginModule.java
index 79714b16aa845084646eece27479dec61a7e9e82..a4b7498da99a5319ab8646df247acf8d6053bb73 100644 (file)
@@ -124,12 +124,15 @@ public class NodeUserLoginModule implements LoginModule, AuthConstants {
        public boolean logout() throws LoginException {
                if (subject == null)
                        throw new LoginException("Subject should not be null");
+               // Clean up principals
                // Argeo
                subject.getPrincipals().removeAll(subject.getPrincipals(X500Principal.class));
                subject.getPrincipals().removeAll(subject.getPrincipals(ImpliedByPrincipal.class));
                // Jackrabbit
                subject.getPrincipals().removeAll(subject.getPrincipals(AdminPrincipal.class));
                subject.getPrincipals().removeAll(subject.getPrincipals(AnonymousPrincipal.class));
+               // Clean up private credentials
+               subject.getPrivateCredentials().clear();
                cleanUp();
                return true;
        }