Class LDAPManager

    • Constructor Detail

      • LDAPManager

        public LDAPManager()
    • Method Detail

      • getInstance

        public static LDAPManager getInstance()
      • getPlatformUserLogins

        protected final java.util.Collection getPlatformUserLogins()
      • browseLDAP

        public java.util.Collection<LDAPGenericObject> browseLDAP​(java.lang.String searchbase,
                                                                  java.lang.String filter,
                                                                  java.lang.String[] attrs)
                                                           throws javax.naming.NamingException
        Throws:
        javax.naming.NamingException
      • browseLDAP

        public java.util.Collection<LDAPGenericObject> browseLDAP​(java.lang.String searchbase,
                                                                  java.lang.String filter,
                                                                  java.lang.String[] attrs,
                                                                  int limit)
                                                           throws javax.naming.NamingException
        Throws:
        javax.naming.NamingException
      • browseLDAP

        public java.util.Collection<LDAPGenericObject> browseLDAP​(LDAPConfigProxyItem config,
                                                                  java.lang.String searchbase,
                                                                  java.lang.String personObjectClass,
                                                                  java.lang.String searchfield,
                                                                  java.lang.String searchOperation,
                                                                  java.lang.String searchvalue,
                                                                  java.lang.String[] attrs)
                                                           throws javax.naming.NamingException
        Performs a directory sub tree search (i.e. of the next level and all subsequent levels below)

        by generating an search expressions with the help of the assigned parameters

        sample:

        the method call browseLDAP("dc=hybris,dc=de", "inetOrgPerson", "cn", "=", "*", new String[] {"cn", "sn", "modifyTimestamp", "creationTimestamp", "displayName"})

        will perform the search (&(objectclass=inetOrgPerson)(cn=*))

        Parameters:
        searchbase - the domain name (relative to initial context in ldap) to seach from.
        personObjectClass -
        searchfield -
        searchOperation -
        searchvalue -
        attrs - an array of strings containing the names of attributes to search. (null = all, empty array = none)
        Returns:
        Collection of LDAPGenericObjects
        Throws:
        javax.naming.NamingException
      • checkPassword

        public boolean checkPassword​(User user,
                                     char[] plainPassword)
        Handles the LDAP authentification process

        This process passes the following steps:

        1. Loading the configured LDAP searchbase (User attribute). -- This value is mandatory! 2. Loading the configured LDAP account (User attribute). -- This value is optional! Note: If this value is , the hybris (hmc) login will be used instead! 3. Loading the configured domain (User attribute). -- This value is optional (Only usefull in an ActiveDirectory environement) 4. Calling checkPassword(final String searchbase, final String login, final char[] plainPassword ), with the submitted/acquired values

        Parameters:
        user - the hybris (hmc) user
        plainPassword - the ldap password
        Returns:
        success
      • checkPassword

        public boolean checkPassword​(java.lang.String searchbase,
                                     java.lang.String login,
                                     char[] plainPassword)
                              throws javax.naming.NamingException
        Throws:
        javax.naming.NamingException
      • createEssentialData

        public void createEssentialData​(java.util.Map _values,
                                        JspContext jspc)
                                 throws java.lang.Exception
        Overrides:
        createEssentialData in class Extension
        Throws:
        java.lang.Exception
      • createDefaultLDIFImportCronJob

        @Deprecated(since="ages",
                    forRemoval=false)
        public LDIFImportCronJob createDefaultLDIFImportCronJob​(boolean enableCodeExecution)
        Deprecated.
        since ages
      • createDefaultLDIFImportCronJob

        public LDIFImportCronJob createDefaultLDIFImportCronJob()
      • createDefaultLDIFImportCronJob

        @Deprecated(since="ages",
                    forRemoval=false)
        public LDIFImportCronJob createDefaultLDIFImportCronJob​(LDIFImportJob ldifImportJob)
        Deprecated.
        since ages
      • createDefaultLDIFImportCronJob

        public LDIFImportCronJob createDefaultLDIFImportCronJob​(LDIFImportJob ldifImportJob,
                                                                boolean enableCodeExecution)
      • getOrCreateLDIFImportJob

        public LDIFImportJob getOrCreateLDIFImportJob()
      • getOrCreateLDIFGroupImportJob

        public LDIFGroupImportJob getOrCreateLDIFGroupImportJob()
      • isCreatorDisabled

        public boolean isCreatorDisabled()
        Part of DataCreator interface. This default implementation returns false.
        Overrides:
        isCreatorDisabled in class Extension
        Returns:
        false
      • cleanse

        public java.lang.String cleanse​(java.lang.String input)