Documentation Index
Fetch the complete documentation index at: https://private-7c7dfe99-page-updates.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
This page isn’t applicable to ClickHouse Cloud. The feature documented here isn’t available in ClickHouse Cloud services.
See the ClickHouse Cloud Compatibility guide for more information.
Configure LDAP connection settings in ClickHouse
-
Test your connection to this public LDAP server:
The reply will be something like this:
-
Edit the
config.xmlfile and add the following to configure LDAP:
The
<test_ldap_server> tags is an arbitrary label to identify a particular LDAP server.| Parameter | Description | Example |
|---|---|---|
| host | hostname or IP of LDAP server | ldap.forumsys.com |
| port | directory port for LDAP server | 389 |
| bind_dn | template path to users | uid={user_name},dc=example,dc=com |
| enable_tls | whether to use secure ldap | no |
| tls_require_cert | whether to require certificate for connection | never |
In this example, since the public server uses 389 and doesn’t use a secure port, we disable TLS for demonstration purposes.
View the LDAP doc page for more details on the LDAP settings.
-
Add the
<ldap>section to<user_directories>section to configure the user role mapping. This section defines when a user is authenticated and what role the user will receive. In this basic example, any user authenticating to LDAP will receive thescientists_rolewhich will be defined at a later step in ClickHouse. The section should look similar to this:These are the basic settings used above:Parameter Description Example server label defined in the prior ldap_servers section test_ldap_server roles name of the roles defined in ClickHouse the users will be mapped to scientists_role base_dn base path to start search for groups with user dc=example,dc=com search_filter ldap search filter to identify groups to select for mapping users (&(objectClass=groupOfUniqueNames)(uniqueMember={bind_dn}))attribute which attribute name should value be returned from cn - Restart your ClickHouse server to apply the settings.
Configure ClickHouse database roles and permissions
The procedures in this section assumes that SQL Access Control and Account Management in ClickHouse has been enabled. To enable, view the SQL Users and Roles guide.
-
Create a role in clickhouse with the same name used in the role mapping section of the
config.xmlfile -
Grant needed privileges to the role. The following statement grants admin privileges to any user able to authenticate through LDAP:
Test the LDAP configuration
- Login using the ClickHouse client
Use the
ldapsearch command in step 1 to view all of the users available in the directory and for all of the users the password is password-
Test that the user was mapped correctly to the
scientists_rolerole and has admin permissions