Class RepositoryAuthenticationDao

    • Field Detail

      • nodeService

        protected org.alfresco.service.cmr.repository.NodeService nodeService
      • tenantService

        protected org.alfresco.repo.tenant.TenantService tenantService
      • namespacePrefixResolver

        protected org.alfresco.service.namespace.NamespacePrefixResolver namespacePrefixResolver
    • Constructor Detail

      • RepositoryAuthenticationDao

        public RepositoryAuthenticationDao()
    • Method Detail

      • setNamespaceService

        public void setNamespaceService​(org.alfresco.service.namespace.NamespacePrefixResolver namespacePrefixResolver)
      • setAuthorityService

        public void setAuthorityService​(AuthorityService authorityService)
      • setNodeService

        public void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)
      • setTenantService

        public void setTenantService​(org.alfresco.repo.tenant.TenantService tenantService)
      • setSingletonCache

        public void setSingletonCache​(org.alfresco.repo.cache.SimpleCache<String,​org.alfresco.service.cmr.repository.NodeRef> singletonCache)
      • setPolicyComponent

        public void setPolicyComponent​(PolicyComponent policyComponent)
      • setAuthenticationCache

        public void setAuthenticationCache​(org.alfresco.repo.cache.SimpleCache<String,​org.alfresco.repo.security.authentication.RepositoryAuthenticationDao.CacheEntry> authenticationCache)
      • setTransactionService

        public void setTransactionService​(TransactionService transactionService)
      • setCompositePasswordEncoder

        public void setCompositePasswordEncoder​(CompositePasswordEncoder compositePasswordEncoder)
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        Exception
      • loadUserByUsername

        public net.sf.acegisecurity.UserDetails loadUserByUsername​(String incomingUserName)
                                                            throws net.sf.acegisecurity.providers.dao.UsernameNotFoundException,
                                                                   org.springframework.dao.DataAccessException
        Specified by:
        loadUserByUsername in interface net.sf.acegisecurity.providers.dao.AuthenticationDao
        Throws:
        net.sf.acegisecurity.providers.dao.UsernameNotFoundException
        org.springframework.dao.DataAccessException
      • getUserOrNull

        public org.alfresco.service.cmr.repository.NodeRef getUserOrNull​(String caseSensitiveSearchUserName)
        Parameters:
        caseSensitiveSearchUserName - case sensitive user name
        Returns:
        the user's authentication node ref or null
      • determinePasswordHash

        public static org.alfresco.util.Pair<List<String>,​String> determinePasswordHash​(Map<org.alfresco.service.namespace.QName,​Serializable> properties)
        Retrieves the password hash for the given user properties.
        Parameters:
        properties - The properties of the user.
        Returns:
        A Pair object containing the hash indicator and the hashed password.
      • createUser

        public void createUser​(String caseSensitiveUserName,
                               char[] rawPassword)
                        throws org.alfresco.repo.security.authentication.AuthenticationException
        Description copied from interface: MutableAuthenticationDao
        Create a user with the given userName and password
        Specified by:
        createUser in interface MutableAuthenticationDao
        Throws:
        org.alfresco.repo.security.authentication.AuthenticationException
      • createUser

        public void createUser​(String caseSensitiveUserName,
                               String hashedPassword,
                               char[] rawPassword)
                        throws org.alfresco.repo.security.authentication.AuthenticationException
        Description copied from interface: MutableAuthenticationDao
        Create a user with the given userName and password hash If hashedPassword is passed in then this is used, otherwise it falls back to using the rawPassword. It is assumed the hashed password has been encoded using system.preferred.password.encoding and doesn't use its own salt.
        Specified by:
        createUser in interface MutableAuthenticationDao
        Throws:
        org.alfresco.repo.security.authentication.AuthenticationException
      • updateUser

        public void updateUser​(String userName,
                               char[] rawPassword)
                        throws org.alfresco.repo.security.authentication.AuthenticationException
        Description copied from interface: MutableAuthenticationDao
        Update a user's password.
        Specified by:
        updateUser in interface MutableAuthenticationDao
        Throws:
        org.alfresco.repo.security.authentication.AuthenticationException
      • deleteUser

        public void deleteUser​(String userName)
                        throws org.alfresco.repo.security.authentication.AuthenticationException
        Description copied from interface: MutableAuthenticationDao
        Delete a user.
        Specified by:
        deleteUser in interface MutableAuthenticationDao
        Throws:
        org.alfresco.repo.security.authentication.AuthenticationException
      • getSalt

        public Object getSalt​(net.sf.acegisecurity.UserDetails userDetails)
        Specified by:
        getSalt in interface net.sf.acegisecurity.providers.dao.SaltSource
      • getUserProperties

        protected Map<org.alfresco.service.namespace.QName,​Serializable> getUserProperties​(String userName)
        Returns:
        Returns the user properties or null if there are none
      • getHasExpired

        protected boolean getHasExpired​(String userName,
                                        Map<org.alfresco.service.namespace.QName,​Serializable> properties,
                                        Boolean isAdminAuthority)
        Parameters:
        userName - the username
        properties - user properties or null to fetch them
      • getLocked

        protected boolean getLocked​(String userName,
                                    Map<org.alfresco.service.namespace.QName,​Serializable> properties,
                                    Boolean isAdminAuthority)
        Parameters:
        userName - the username
        properties - user properties or null to fetch them
      • getCredentialsExpire

        protected boolean getCredentialsExpire​(String userName,
                                               Map<org.alfresco.service.namespace.QName,​Serializable> properties)
        Parameters:
        userName - the username
        properties - user properties or null to fetch them
      • getCredentialsHaveExpired

        protected boolean getCredentialsHaveExpired​(String userName,
                                                    Map<org.alfresco.service.namespace.QName,​Serializable> properties,
                                                    Boolean isAdminAuthority)
        Parameters:
        userName - the username (never null
        properties - the properties associated with the user or null to get them
        isAdminAuthority - is admin authority
        Returns:
        true if the user account has expired
      • getEnabled

        protected boolean getEnabled​(String userName,
                                     Map<org.alfresco.service.namespace.QName,​Serializable> properties,
                                     Boolean isAdminAuthority)
        Parameters:
        userName - the username
        properties - the user's properties or null
      • onUpdateUserProperties

        public void onUpdateUserProperties​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                           Map<org.alfresco.service.namespace.QName,​Serializable> before,
                                           Map<org.alfresco.service.namespace.QName,​Serializable> after)