]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - security/runtime/org.argeo.security.core/src/main/java/org/argeo/security/jcr/OsJcrAuthenticationProvider.java
First working remote node
[lgpl/argeo-commons.git] / security / runtime / org.argeo.security.core / src / main / java / org / argeo / security / jcr / OsJcrAuthenticationProvider.java
index 2eadf5669724e5f7cb6000e2819f766f929e72c5..9abac5972a7f584fc1aaca81326d49877e4c41af 100644 (file)
@@ -35,7 +35,7 @@ public class OsJcrAuthenticationProvider extends OsAuthenticationProvider {
                                Session session = null;
                                try {
                                        session = repository.login(workspace);
-                                       // WARNING: at this stage we assume that teh java properties
+                                       // WARNING: at this stage we assume that the java properties
                                        // will have the same value
                                        String userName = System.getProperty("user.name");
                                        Node userHome = JcrUtils.getUserHome(session, userName);
@@ -44,6 +44,7 @@ public class OsJcrAuthenticationProvider extends OsAuthenticationProvider {
                                                                homeBasePath, userName);
                                        // authen.setDetails(getUserDetails(userHome, authen));
                                } catch (RepositoryException e) {
+                                       JcrUtils.discardQuietly(session);
                                        throw new ArgeoException(
                                                        "Unexpected exception when synchronizing OS and JCR security ",
                                                        e);