Configuring LDAP Authentication

Prerequisites

Configuring LDAP Authentication

When configuring LDAP authentication, you need to match Connectware’s setting to the capabilities of your LDAP server. There are two fundamental decisions to make:

  1. Choosing between “group” and “attribute” mode.

  2. Whether to use a bind user.

Connectware LDAP Modes

Connectware offers two modes for LDAP authentication:

  • Group mode

  • Attribute mode

For more information, see Connectware LDAP Modes.

Using a Bind User

A bind user is common in LDAP setup that use a more complicated directory structure. It is a limited user you create in your LDAP directory, that is usually a read-only user with the permission to search through the LDAP directory tree.

It is used when users don’t share a single LDAP base DN (e.g. are not in the same group). If your users are spread among the directory tree, you will likely want to use a bind user.

Enabling LDAP Authentication

To enable the LDAP feature in Connectware, you need to set the Helm value global.authentication.ldap.enabled to true.

Additionally, you always need to provide these Helm values within the global.authentication.ldap context:

Value
Example
Description

bindDn

CN=Users,DC=example,DC=org

bindDN contains either the LDAP base DN of users logging in, or the DN of a dedicated bind user that is able to search for the user trying to log in within the search base.

url

ldap://dc.mycompany.tld:389

URL of the LDAP server in format schema://hostname:port

Example

global:
    authentication:
        ldap:
            enabled: true
            bindDn: CN=Users,DC=company,DC=tld
            url: ldap://my-dc.complany.tld:389

If you are using a bind user to search through the directory tree, you must specify the full DN of the bind user as bindDn, and also need to provide these values:

Value
Example
Description

bindPassword

ANc97WCO"!xcC=(

bindPassword contains the password for the bind user as defined in your LDAP server.

searchBase

ldap://dc.mycompany.tld:389

URL of the LDAP server in format schema://hostname:port

Example

global:
    authentication:
        ldap:
            enabled: true
            bindDn: CN=connectwarebinduser,CN=Users,DC=company,DC=tld
            bindPassword: SuperS3cret!
            url: ldap://my-dc.complany.tld:389
            searchBase: CN=Users,DC=company,DC=tld

If you don’t want to provide the bind user and its password through your Helm values, for example because you follow a GitOps approach for your Connectware deployment, you can also provide the bind user through a manually created Kubernetes secret that is specified in existingBindSecret. For more information, see Manual Kubernetes Secret for LDAP Authentication Bind User.

By providing a bindPassword through one of these mechanisms, the nature of bindDn changes from being a single base DN that contains all users that are allowed to log into Connectware, to containing the DN of a single user – the bind user. In this scenario, searchBase takes the role of containing the base DN which all users share, acting as the root from which a search for valid users will be performed.

Configuring Group Mode

To configure Connectware to use LDAP in group mode, you need to specify the LDAP attribute of your user, that specifies what LDAP groups they are part of. This is done through the Helm value memberAttribute within the global.authentication.ldap context. Additionally, mode must be set to group.

The default value of memberOf is often the correct choice, but you may have to adapt this to your LDAP server.

These LDAP groups are then mapped to Connectware roles using the Connectware UI. For more information, see Connectware LDAP Modes.

Example

global:
    authentication:
        ldap:
            enabled: true
            bindDn: CN=Users,DC=company,DC=tld
            url: ldap://my-dc.complany.tld:389
            mode: group
            memberAttribute: memberOf

Configuring Attribute Mode

To configure Connectware to use LDAP in attribute mode, you need to specify the LDAP attribute of your user, that specifies the Connectware role that is associated with the user. This is done through the Helm value rolesAttribute within the global.authentication.ldap context. Additionally, mode must be set to attribute.

The default value of employeeType is often the correct choice, but you may have to adapt this to your LDAP server.

Example

global:
    authentication:
        ldap:
            enabled: true
            bindDn: CN=Users,DC=company,DC=tld
            url: ldap://my-dc.complany.tld:389
            mode: attribute
            rolesAttribute: employeeType

Further LDAP Topics

Enabling TLS for LDAP

Connectware supports connecting to LDAP servers that offer Transport Layer Security. You can find out how to configure this in this article.

Providing Bind User through an Existing Kubernetes Secret

You can provide the bind user through a manually created Kubernetes secret that is specified in existingBindSecret. You can find detailed instructions in this article.

Customizing the Search Filter

By default the username trying to log in acts as the search filter, but there may be advanced situations where this is not enough, for example when that matches multiple users. Visit this article to learn how to customize the search filter.

Customizing the User RDN

The user RDN describes what LDAP attribute contains the username. By default this uses cn, but if this is not correct for your LDAP setup, you can customize this using the userRdn Helm value. Find out more in this article.

Related Links

Last updated

Was this helpful?