# Configure LDAP settings

Windows Active Directory is a directory service created by Microsoft. Active Directory uses a number of standardized protocols to provide a variety of network service, including LDAP. LDAP is Lightweight Directory Access Protocol for accessing directories over an IP network.

You configure LDAP settings in the following way:

1. In the main menu, click *Administration » Settings*.\
   The *Basic Settings* page appears.

2. Click *Advanced* link.\
   The *Settings* page appears.

3. Expand *Security* node in the left of the page.

4. Click *LDAP Settings* » *LDAP Connections*.\
   A list of all configured connections appears. You can edit an existing connection by clicking it or you can create a new connection by clicking *Create new* button.

5. Configure the following properties:

    <table cellspacing="0" cellpadding="0" class="DocTable">
    <colgroup><col><col></colgroup>
    <tbody>
    <tr>
    <td class="myClassTableHeaderFirstCol">

   <em>Name</em>

    </td>
    <td>

   The name of the connection is used for distinguishing LDAP connections in Sitefinity.

    </td>
    </tr>
    <tr>
    <td class="myClassTableFirstCol">

   <em>LDAP Server address</em><br>

    </td>
    <td>

   Enter the name of the server where LDAP is hosted.

   > info **NOTE**: In case you want to use a backup server, you can enter more than one server with its fully-qualified DNS host name separated by semicolon. For example enter, `myhost.example.com;mybackupserver.example.com`

    </td>
    </tr>
    <tr>
    <td class="myClassTableFirstCol">

   <em>LDAP Server port</em>

    </td>
    <td>

   Enter the LDAP server port. <br>
   The default port is 636.

    </td>
    </tr>
    <tr>
    <td class="myClassTableFirstCol">

   <em>The domain used in addition to the user name</em>

    </td>
    <td>

   Enter the domain of the LDAP server.<br>

    </td>
    </tr>
    <tr>
    <td class="myClassTableFirstCol">

   <em>User name used to connect to the LDAP server</em>

    </td>
    <td>

   Enter the username for logging to the LDAP server.
   You can use a regular user.<br>

    </td>
    </tr>
    <tr>
    <td class="myClassTableFirstCol">

   <em>Password used to connect to the LDAP server</em>

    </td>
    <td>

   Enter the password for logging to the LDAP server.

    </td>
    </tr>
    <tr>
    <td class="myClassTableFirstCol">

   <em>Use SSL for the connection</em>

    </td>
    <td>

   Indicates whether the connection use SSL or not

    </td>
    </tr>
    <tr>
    <td class="myClassTableFirstCol">

   <em>ResultCacheExpirationTime</em>

    </td>
    <td>

   Enter the seconds, for which the system caches the LDAP server response results.

    </td>
    </tr>
    <tr>
    <td class="myClassTableFirstCol">

   <em>Maximum number of users to be returned</em>

    </td>
    <td>

   Enter the maximum number of users that is returned on one request to the LDAP. This number is used for internal paging of results, in order to avoid overconsumption of memory and slow retrieval of big chunks of data.

    </td>
    </tr>
    <tr>
    <td class="myClassTableFirstCol">

   <em>Root distinguished name used to retrieve the users</em>

    </td>
    <td>

   Enter the base/root distinguished name (DN) for the users.

    </td>
    </tr>
    <tr>
    <td class="myClassTableFirstCol">

   <em>LDAP filter used when getting the users</em>

    </td>
    <td>

   Enter the filter that is applied when requesting users from the LDAP. You must use the standard LDAP query syntax.

    </td>
    </tr>
    <tr>
    <td class="myClassTableFirstCol">

   <em>Maximum number of the returned roles</em>

    </td>
    <td>

   Enter the maximum number of roles that is returned on one request to the LDAP. This number is used for internal paging of results, in order to avoid overconsumption of memory and slow retrieval of big chunks of data.

    </td>
    </tr>
    <tr>
    <td class="myClassTableFirstCol">

   <em>Root distinguished name used to retrieve the user roles</em>

    </td>
    <td>

   Enter the base/root distinguished name (DN) for the roles.

    </td>
    </tr>
    <tr>
    <td class="myClassTableFirstCol">

   <em>LDAP filter used when getting the user roles</em>

    </td>
    <td>

   Enter the filter applied when requesting users from the LDAP. You must use the standard LDAP query syntax.

    </td>
    </tr>
    <tr>
    <td class="myClassTableFirstCol">

   <em>ConnectWithLogOnCredentials</em>

    </td>
    <td>

   Indicates whether to use the identity of the application pool that Sitefinity CMS is running under to authenticate towards LDAP.

   > info **NOTE**: You can use this setting only if you have selected NTLM as logon authentication type.

    </td>
    </tr>
    <tr>
    <td class="myClassTableFirstCol">

   <em>LDAP protocol version</em>

    </td>
    <td>

   The default LDAP protocol version is <em>2</em>. You can switch to version <em>3</em> by entering `3` in the input field.

    </td>
    </tr>
    <tr>
    <td class="myClassTableFooterFirstCol">

   <em>LDAP authentication type</em>

    </td>
    <td>

   Enter the type of authentication.

   The default type is *Negotiate*, which indicates that Microsoft Negotiate authentication is used on the connection.

    </td>
    </tr>
    </tbody>
    </table>

6. When you are finished with the configurations, click *Save changes*.

7. To select which is the default LDAP connection to be used, click *LDAP Settings* and enter the name of the connection in *DefaultLdapConnection* input field and click *Save changes* button.

   > success **EXAMPLE**: The following screenshot shows an example of an LDAP configuration:\
   > [![](https://www.progress.com/documentation/sitefinity-cms/assets/4ed9e22aee41097e2c23e5a135585ea5/ldap_new.png "ldap_new")](https://www.progress.com/documentation/sitefinity-cms/assets/4ed9e22aee41097e2c23e5a135585ea5/ldap_new.png)

8. After configuring the LDAP settings on the *Settings* page, perform the following:
   1. Click *Security* » *Membership Providers* » *LdapUsers*.\
      Select *Enabled* checkbox and click *Save changes*.
   2. Click *Security* » *Role Providers* » *LdapRoles*.\
      Select *Enabled* checkbox and click *Save changes*.

9. Restart the application.

> info **RECOMMENDATION**: We recommend that you set the maximum query string in the requesting filtering configuration to 7200. This is useful if you are going to setup SSO with LDAP membership provider, because the default length is 2048 bytes and query strings longer than this are rejected and return HTTP error.\
> To do this, open the `web.config` file and under `<system.webServer>` node, insert the following:
>
> ```XML
> <security>
>  <requestFiltering>
>    <requestLimits maxQueryString="7200" />
>  </requestFiltering>
> </security>
> ```

## Additional information about LDAP

LDAP is based on X.500 specification and specified in Directory service (RFC1777). It stores attribute based data and is more often used to read than to write to the directory. There are no transactions and no rollback.   LDAP has a hierarchical data structure. Directory entries are in a tree-like structure called Directory Information Tree (DIT). The following screenshot displays a sample DIT:
[![](https://www.progress.com/documentation/sitefinity-cms/assets/b80928a39d47326a778776728fbf6bc7/ldap_hierarchy.png "ldap_hierarchy")](https://www.progress.com/documentation/sitefinity-cms/assets/b80928a39d47326a778776728fbf6bc7/ldap_hierarchy.png)

LDAP uses the following attribute abbreviations:

 <table cellspacing="0" cellpadding="0" class="DocTable">
<colgroup><col><col></colgroup>
<tbody>
<tr>
<td class="myClassTableHeaderFirstCol">

`uid`

</td>
<td>

User ID

</td>
</tr>
<tr>
<td class="myClassTableFirstCol">

`cn`

</td>
<td>

Common Name

</td>
</tr>
<tr>
<td class="myClassTableFirstCol">

`sn`

</td>
<td>

Surname

</td>
</tr>
<tr>
<td class="myClassTableFirstCol">

`l`

</td>
<td>

Location

</td>
</tr>
<tr>
<td class="myClassTableFirstCol">

`ou`

</td>
<td>

Organizational Unit

</td>
</tr>
<tr>
<td class="myClassTableFirstCol">

`o`

</td>
<td>

Organization

</td>
</tr>
<tr>
<td class="myClassTableFirstCol">

`dc`

</td>
<td>

Domain Component

</td>
</tr>
<tr>
<td class="myClassTableFirstCol">

`st`

</td>
<td>

State

</td>
</tr>
<tr>
<td class="myClassTableFooterFirstCol">

`c`

</td>
<td>

Country

</td>
</tr>
</tbody>
</table>

#### Search filters

The following table lists the meaning of operators used in search filters: <table cellspacing="0" cellpadding="0" class="DocTable">

<colgroup><col><col></colgroup>
<tbody>
<tr>
<td class="myClassTableHeaderFirstCol">

<strong>Symbol</strong>

</td>
<td>

<strong>Meaning</strong>

</td>
</tr>
<tr>
<td class="myClassTableFirstCol">

`&`

</td>
<td>

AND

</td>
</tr>
<tr>
<td class="myClassTableFirstCol">

`|`

</td>
<td>

OR

</td>
</tr>
<tr>
<td class="myClassTableFirstCol">

`!`

</td>
<td>

NOT

</td>
</tr>
<tr>
<td class="myClassTableFirstCol">

`~=`

</td>
<td>

Approximately equal

</td>
</tr>
<tr>
<td class="myClassTableFirstCol">

<span class="Code">>= </span>

</td>
<td>

Greater than or equal

</td>
</tr>
<tr>
<td class="myClassTableFirstCol">

<span class="Code"><= </span>

</td>
<td>

Less than or equal

</td>
</tr>
<tr>
<td class="myClassTableFooterFirstCol">

`*`

</td>
<td>

any

</td>
</tr>
</tbody>
</table>

> success **EXAMPLE**: The following are examples of search filters:
>
> * `(objectclass=posixAccount)`
> * `(cn=Mickey M*)`
> * `(|(uid=fred)(uid=bill))`
> * `(&(|(uid=jack)(uid=jill))(objectclass=posixAccount))`
