]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - security/runtime/org.argeo.security.core/src/main/java/org/argeo/security/jcr/JcrAuthenticationProvider.java
Introduce OSAuthentication
[lgpl/argeo-commons.git] / security / runtime / org.argeo.security.core / src / main / java / org / argeo / security / jcr / JcrAuthenticationProvider.java
index b7680ad1b338eea1600e9e3e98ee4ff0a91caae0..9791da8a017fa0988df49475107ac7ca98d00188 100644 (file)
@@ -79,19 +79,23 @@ public class JcrAuthenticationProvider implements AuthenticationProvider {
        }
 
        /** Builds user details based on the authentication and the user home. */
-       protected UserDetails getUserDetails(Node userHome,
-                       JcrAuthenticationToken authen) {
+       protected UserDetails getUserDetails(Node userHome, Authentication authen) {
                try {
                        // TODO: loads enabled, locked, etc. from the home node.
                        return new JcrUserDetails(userHome.getPath(), authen.getPrincipal()
-                                       .toString(), authen.getCredentials().toString(), true,
-                                       true, true, true, authen.getAuthorities());
+                                       .toString(), authen.getCredentials().toString(),
+                                       isEnabled(userHome), true, true, true,
+                                       authen.getAuthorities());
                } catch (Exception e) {
                        throw new ArgeoException("Cannot get user details for " + userHome,
                                        e);
                }
        }
 
+       protected Boolean isEnabled(Node userHome) {
+               return true;
+       }
+
        @SuppressWarnings("rawtypes")
        public boolean supports(Class authentication) {
                return SiteAuthenticationToken.class.isAssignableFrom(authentication);