LDAP Connection (Aspire 2)

From wiki.searchtechnologies.com
Jump to: navigation, search

For Information on Aspire 3.1 Click Here

 (2.1 Release)  

LDAP Connection (Aspire 2)
Factory Name  com.searchtechnologies.aspire:aspire-ldap
subType  default
Inputs  N/A
Outputs  N/A

The Aspire LDAP Connection component enables other Aspire components to access LDAP services. The component connects to LDAP and implements the AspireLDAP interface, allowing LDAP queries, look-ups and binds. The component provides no job processing.


Configuration

Element Type Default Description
server string   LDAP server host address. Example: ldap//10.10.44.82:389
protocol string   LDAP server protocol.
contextFactory string com.sun.jndi.ldap.LdapCtxFactory The java class to use as the context factory when connecting.
authentication string anonymous Authentication type used for any LDAP request. Options are 'none', 'simple' and 'DIGEST-MD5'.
user string N/A Username used to authenticate against the given LDAP server. If 'none' authentication type was selected, you can ignore this.
password string N/A Password used to authenticate against the given LDAP server. If 'none' authentication type was selected, you can ignore this.
readTimeout int 600000
(=60s)
Read timeout in ms. The period may be entered in milliseconds, or with the suffix ms, s, m, h, d to indicate the units
connectTimeout int 600000
(=60s)
Connection timeout in ms. The period may be entered in milliseconds, or with the suffix ms, s, m, h, d to indicate the units
connectionPool boolean true Indicates if a connection pool to the LDAP server should be used.
referral string ignore LDAP search referral type.
maxRetries long 1 The number of retries attempted, should an error occur, for an LDAP request before an Exception is thrown
retryDelay long 0 The delay following an error before a retry is attempted. The period may be entered in milliseconds, or with the suffix ms, s, m, h, d to indicate the units
pageSize int 1000 The page size of the search query (max 1000). If there are less results for a search than the page size, a single page will be returned. If there are more, the results will be returned in pages. This will be transparent to the client
binaryAttribute String objectSid The name of an attribute that should be handled as bytes rather than a string

Example Configurations

Simple

  <component name="LDAPConnection" subType="default" factoryName="aspire-ldap" enable="${enableLdapConnector}">
    <debug>false</debug>
    <server>ldap://ldapserver:389</server>
     <authentication>simple</authentication>
    <user>contoso\user</user>
    <password>XXXXX</password>
    <readTimeout>15s</readTimeout>
    <pageSize>100</pageSize>
    <retries>3</retries>
    <retryDelay>5s</retryDelay>
  </component>

Accessing LDAP Cnnection from a Groovy component

If you may want to perform LDAP operations from Groovy components, you can use its public interface AspireLDAP to perform other operations.

For example, if you had installed an LDAP Connection component using the example configuration above, you could access if from a Groovy component as shown below:

  <component name="GroovyTest" subType="default" factoryName="aspire-groovy">
    <variable name="ldap" component="LDAPConnection"/>
      <script>
        println(ldap.lookup("cn=userXX,ou=people,dc=contoso,dc=com"));
      </script>
  </component>