Wiki

Clone wiki

LdapAuth / Configuration

Configuration of the system is via the web.config and mapping function in the ldapauth file.

The web.config enables the connection to the local AD via a local LDAP connection string.

#!xml

  <appSettings> 
      <!--  LDAPServers
          Can contain one or a comma seperated list of LDAP servers     -->
          <add key="LDAPServers" value="LDAP://gnsbs01" />
      <!--  DomainPrefix
          Can contain one or a comma seperated list of DomainPrefixes, need to have the same number like LDAP servers and will be used in collaboration     -->
      <add key="DomainPrefix" value="gael" />
  </appSettings>

The mapping function SKNameToADNameMappings can be left in its default state or it can be adapted to allow fields named in the AD to be mapped across to their equivalent fields in the Sitekit user base.

#!c#
        //IMPORTANT : Put the Sitekit user parameter names and their corresponding Active Directory
        //            parameter names in this table.
        private string[,] SKNameToADNameMappings = {
        {
            "Fullname",
            "cn"
        },
        {
            "Telephone",
            "telephonenumber"
        },
        {
            "Fax",
            "facsimileTelephoneNumber"
        },
        {
            "Email",
            "mail"
        },
        {
            "Department",
            "department"
        },
        {
            "Job",
            "title"
        },
        {
            "Extension Number",
            "pager"
        },
        {
            "Notes",
            "info"
        }

    };

In addition to the above the individual ldap queries in any of the function can be extended to add additional filtering using standard LDAP query syntax. This could be useful in case where there's a large group of individuals in the AD but only a subset of this is wanted to have access to the system. For example

#!vb

            Dim search As DirectorySearcher = New DirectorySearcher(entry)
            search.Filter = "(SAMAccountName=" & usernameWithoutDomain & ")"  'this can be extended to accomodate more filters

Updated