Class LDAPConfiguration

java.lang.Object
com.jalios.ldap.LDAPConfiguration

public class LDAPConfiguration extends Object
  • Field Details

    • LDAP_ENABLED

      public static final String LDAP_ENABLED
      See Also:
    • LDAP_SYNCHRONIZE

      public static final String LDAP_SYNCHRONIZE
      See Also:
    • LDAP_SYNCHRONIZE_AUTH

      public static final String LDAP_SYNCHRONIZE_AUTH
      See Also:
    • LDAP_SYNCHRONIZE_GROUPS

      public static final String LDAP_SYNCHRONIZE_GROUPS
      See Also:
    • LDAP_SERVER_SSL

      public static final String LDAP_SERVER_SSL
      See Also:
    • LDAP_SERVER_HOSTNAME

      public static final String LDAP_SERVER_HOSTNAME
      See Also:
    • LDAP_SERVER_LOGIN

      public static final String LDAP_SERVER_LOGIN
      See Also:
    • LDAP_SERVER_PORT

      public static final String LDAP_SERVER_PORT
      See Also:
    • LDAP_SERVER_SIZE_LIMIT

      public static final String LDAP_SERVER_SIZE_LIMIT
      See Also:
    • LDAP_SERVER_TIME_LIMIT

      public static final String LDAP_SERVER_TIME_LIMIT
      See Also:
    • LDAP_SERVER_VERSION

      public static final String LDAP_SERVER_VERSION
      See Also:
    • LDAP_SERVER_PASSWORD

      public static final String LDAP_SERVER_PASSWORD
      See Also:
    • LDAP_SERVER_CLIENT_CERTIFICATE_ENABLED

      public static final String LDAP_SERVER_CLIENT_CERTIFICATE_ENABLED
      See Also:
    • LDAP_SERVER_SUFFIX

      public static final String LDAP_SERVER_SUFFIX
      See Also:
    • LDAP_SERVER_USER_FILTER

      public static final String LDAP_SERVER_USER_FILTER
      See Also:
    • LDAP_SERVER_USER_OBJECTCLASS

      public static final String LDAP_SERVER_USER_OBJECTCLASS
      See Also:
    • LDAP_SERVER_GROUP_SUFFIX

      public static final String LDAP_SERVER_GROUP_SUFFIX
      See Also:
    • LDAP_SERVER_GROUP_FILTER

      public static final String LDAP_SERVER_GROUP_FILTER
      See Also:
    • LDAP_SERVER_GROUP_OBJECTCLASS

      public static final String LDAP_SERVER_GROUP_OBJECTCLASS
      See Also:
    • LDAP_SERVER_GROUP_MAPPING_UUID

      public static final String LDAP_SERVER_GROUP_MAPPING_UUID
      See Also:
    • enabled

      protected boolean enabled
    • synchronize

      protected boolean synchronize
    • synchronizeAuth

      protected boolean synchronizeAuth
    • synchronizeGroups

      protected boolean synchronizeGroups
    • hostname

      protected String hostname
    • login

      protected String login
    • password

      protected String password
    • port

      protected int port
    • sizeLimit

      protected int sizeLimit
    • timeLimit

      protected int timeLimit
    • version

      protected int version
    • isSSL

      protected boolean isSSL
    • clientCertificateEnabled

      protected boolean clientCertificateEnabled
    • suffix

      protected String suffix
    • userFilter

      protected String userFilter
    • userObjectClass

      protected String userObjectClass
    • groupSuffix

      protected String groupSuffix
    • groupFilter

      protected String groupFilter
    • groupObjectClass

      protected String groupObjectClass
    • isUsingPosixGroup

      protected boolean isUsingPosixGroup
    • groupMappingUUID

      protected String groupMappingUUID
  • Constructor Details

    • LDAPConfiguration

      public LDAPConfiguration(JProperties props)
      Build a new LDAPConfiguration from properties "ldap.*" available in the specified JProperties.
      Parameters:
      props - the properties from which LDAPConfiguration is being built
    • LDAPConfiguration

      public LDAPConfiguration(JProperties props, String serverConf)
      Build a new LDAPConfiguration from properties "ldap.*" available in the specified JProperties, trying to retrieve custom properties from the specified configuration prior to using default properties.

      For example, given the following properties :

       ldap.server.hostname: ldap.example.com
       ldap.server.login: foo
       ldap.server.password: bar
       ldap.server.conf2.hostname: other-domain-ldap.example.com
       
      Invoking this constructor
         LDAPConfiguration conf = new LDAPConfiguration(channel.getProperties("ldap"), "conf2");
         assertEquals("other-domain-ldap.example.com", conf.getHostname());
         assertEquals("foo", conf.getLogin());
         assertEquals("bar", conf.getPassword());
       
      Parameters:
      props - the properties from which LDAPConfiguration is being built
      serverConf - an optional subconfiguration to use after "ldap.server." default prefix, to retrieve Server configuration options
  • Method Details

    • readProperties

      protected void readProperties(JProperties prop, String serverConf)
    • isEnabled

      public boolean isEnabled()
      Returns:
      true if LDAP is enabled for this configuration.
    • getSynchronize

      public boolean getSynchronize()
      Check if synchronization of user is enabled for this configuration.
      Returns:
      true if the user being retrieve from ldap should be synchronized in JCMS.
    • getSynchronizeDuringAuthentication

      public boolean getSynchronizeDuringAuthentication()
      Check if synchronization of user (and their groups if enabled) is to be performed during authentication.
      Returns:
      true if the synchronisation should occurs during authentication, false otherwise
      Since:
      jcms-10.0.3 / JCMS-6382
    • getSynchronizeGroups

      public boolean getSynchronizeGroups()
      Check if synchronization of groups is enabled for this configuration.
      Returns:
      true if the LDAP groups of the user being retrieve from LDAP should be synchronized in JCMS.
    • isSSL

      public boolean isSSL()
      Returns:
      true if SSL in enabled for this configuration
    • getHostname

      public String getHostname()
      Returns:
      the hostname of the LDAP Server for this configuration
    • getLogin

      public String getLogin()
      Returns:
      the DN that should be used to connect/bind/authenticated to the LDAP server.
    • getPassword

      public String getPassword()
      Returns:
      the password that should be used to connect/bind/authenticated to the LDAP server.
    • setPassword

      public void setPassword(String password)
    • setLogin

      public void setLogin(String login)
    • getPort

      public int getPort()
      Returns:
      the port number that should be used to connect to the LDAP server.
    • getSizeLimit

      public int getSizeLimit()
      Returns:
      the size limit value that should be used during connection to the LDAP server, it defines the maximum number of result that can be retrieved during a search.
    • getTimeLimit

      public int getTimeLimit()
      Returns:
      the time limit value that should be used during connection to the LDAP server, it defines the maximum number of milliseconds to wait for an operation to complete.
    • getVersion

      public int getVersion()
      Returns:
      the protocol version to use to connect to the LDAP server.
    • getSuffix

      public String getSuffix()
      Returns:
      the base DN that should be used when searching users in the LDAP.
    • getUserFilter

      public String getUserFilter()
      Returns:
      a String that should be processed by the method MessageFormat.format(java.lang.String, java.lang.Object[]) and used to search for users in the LDAP.
    • setUserFilter

      public void setUserFilter(String userFilter)
    • getUserObjectClass

      public String getUserObjectClass()
      Returns:
      the objectClass value which defines that a LDAPEntry is a user.
      Since:
      jcms-5.7
    • setUserObjectClass

      public void setUserObjectClass(String userObjectClass)
    • getGroupSuffix

      public String getGroupSuffix()
      Returns:
      the base DN that should be used when searching groups in the LDAP.
      Since:
      jcms-5.7
    • getGroupFilter

      public String getGroupFilter()
      Returns:
      a String that should be processed by the method MessageFormat.format(java.lang.String, java.lang.Object[]) and used to search for groups in the LDAP.
      Since:
      jcms-5.7
    • setGroupFilter

      public void setGroupFilter(String groupFilter)
    • getGroupObjectClass

      public String getGroupObjectClass()
      Returns:
      the objectClass value which defines that a LDAPEntry is a group.
      Since:
      jcms-5.7
    • setGroupObjectClass

      public void setGroupObjectClass(String groupObjectClass)
    • getGroupMappingUUID

      public String getGroupMappingUUID()
      Returns:
      the name of the LDAP attribute used as UUID for group mapping.
      Since:
      jcms-10.0.3 - JCMS-7454
    • setGroupMappingUUID

      public void setGroupMappingUUID(String groupMappingUUID)
    • isUsingPosixGroup

      public boolean isUsingPosixGroup()
      Returns:
      true if the settings of this LDAPConfiguration define that the group being used is a posixGroup (groupObjectClass is "posixGroup" and groupFilter contains "memberUid").
      Since:
      jcms-5.7