Skip to content

LDAP Single Sign-On

LDAP (Lightweight Directory Access Protocol) is an application protocol used for processing a variety of directory services. Microsoft Entra ID supports this mode through Microsoft Entra Domain Services (AD DS).

Deployment Plan supports one-click login for users who already have an LDAP service. The following are some required configuration fields:

Field Description
host The LDAP server domain name. Supports a domain name, ldap://domain:port, or ldaps://domain:port. If you need to specify a port, include it directly in the address; a separate server.port configuration will not take effect.
baseDN The base directory location. Refer to [Field Concept Supplement]
bindDN The username information (DN) used for authentication when establishing a connection with the LDAP service.
searchAttribute The entry name used to filter accounts when searching for other accounts. This entry name, together with the username entered by the user, forms a DIT entry. (This value can identify a unique user based on the username.)
bindPassword The password used for authentication when establishing a connection with the LDAP service.
mapping The attribute field mapping information from account attributes that needs to be mapped to the platform.

The attribute values corresponding to account attributes in LDAP are generally lists. If the attribute value is an array/list structure on the platform, the first element is taken by default as the value. Refer to [Field Concept Supplement > 2. Account Attribute Fields]
Field Concept Supplement
  1. Directory Information Tree (DIT): A DIT is a hierarchical structure similar to a file system. To identify an entry, you must specify its path in the DIT, starting from the leaf that represents the entry and continuing to the top of the tree. This path is called the entry's Distinguished Name (DN);

    • Entry Distinguished Name (DN): Consists of comma-separated key-value pairs of the entry's name and value, forming the path from the leaf to the top of the tree. An entry's DN is unique throughout the entire DIT and changes only when the entry is moved to another container within the DIT.
  2. Account attribute fields:

Account attribute on the platform Platform-side field description Account attribute provided on the LDAP service side, after conversion by ldap3 (default fields)
username The username of the login account; if not returned, a username is generated from the email uid
email The email attribute of the login account; if a non-empty value is returned, it must be a valid email address mail
mobile The mobile number field name of the login account in the authentication service; optional mobile
exterId The unique identifier field name of the login account in the authentication service; required uid

Extended Authentication Methods

Existing single-address deployments can retain the original configuration when upgrading. Before enabling extended capabilities, verify the version, compatibility, and acceptance requirements in the corresponding documentation.

Configuration Details

Add the following configuration in the Launcher namespace: forethought-core > core. Be sure to adjust the configuration variable values:

# LDAP client configuration (see https://ldap3.readthedocs.io/en/latest/server.html for the main configuration)
LDAPClientSet:
  # Whether to enable LDAP; disabled by default
  enable: false
  # The parameter format of server follows https://ldap3.readthedocs.io/en/latest/server.html
  server:
    # LDAP server domain name; can be a domain name, ldap://xxx, or ldaps://xxx
    host: "ipa.demo1.freeipa.org"
    # Connection timeout
    connect_timeout: 6
    # Controls whether SSL is enabled
    use_ssl: false
    # Specifies whether the server schema and server-specific information must be read (default: SCHEMA). See https://ldap3.readthedocs.io/en/latest/server.html#server-object for the available values
    get_info: "SCHEMA"
    tls:
      # No default value; the file path that contains the client private key
      local_private_key_file:
      # No default value; the file path of the server's certificate
      local_certificate_file:
      # No default value; the file path that contains the certificate authority certificate
      ca_certs_file:
      # No default value; a string that specifies which ciphers must be used. It applies to the latest Python interpreters and allows the ciphers in the SSLContext or wrap_socket() method to be changed; it is ignored in older versions. Default: none
      ciphers:
      # Specifies whether the server certificate must be validated. Available values: CERT_NONE (ignore the certificate), CERT_OPTIONAL (not required, but validated if provided), and CERT_REQUIRED (required and validated)
      validate: "CERT_REQUIRED"
      # The SSL or TLS version to use. Can be one of: SSLv2, SSLv3, SSLv23, TLSv1 (per Python 3.3; the version list may differ in other Python versions). Currently defaults to TLS 1.2
      version: "PROTOCOL_TLSv1_2"
  connection:
    # No default value; when accessing Active Directory with ldap3, you can also connect to an Active Directory server using the NTLM v2 protocol. In that case, set this to NTLM
    authentication:
    # authentication, sasl_mechanism, and sasl_credentials here should follow https://ldap3.readthedocs.io/en/latest/bind.html?highlight=Active%20Directory#digest-md5
    # No default value; when accessing Active Directory, sasl_mechanism can be DIGEST_MD5; no default value
    sasl_mechanism:
    # When accessing Active Directory, you need to
    # To use the DIGEST-MD5 mechanism, you must pass a 4-value or 5-value tuple as sasl_credentials: (realm, user, password, authz_id, enable_signing). If you do not use it, you can pass None for 'realm', 'authz_id', and 'enable_signing':
    sasl_credentials:
  # Whether to enable TLS on top of the standard connection; if true, TLS will be checked and enabled after the LDAP connection is established
  startTls: false
  baseDN: "dc=demo1,dc=freeipa,dc=org"
  bindDN: "uid=admin,cn=users,cn=accounts,dc=demo1,dc=freeipa,dc=org"
  bindPassword: "Secret123"
  # The attribute used to search for accounts; Option 1: `searchAttribute: uid` only specifies the attribute field name; Option 2: `searchAttribute: "(uid={username})"` custom filter statement. In this case, username in the parentheses and braces is required.
  # Note: for AD users, this is generally set to sAMAccountName
  searchAttribute: "uid"
  # The object class corresponding to the account information when searching for accounts. Note: if the counterpart is LDAP on Microsoft AD, configure according to the actual directory, e.g., person;
  # To confirm, install `ldapsearch` (a third-party LDAP connection tool) and run the command `ldapsearch -x -H ldap://xxx.cn:389 -D "bindDN信息" -w "bindPassword信息" -b "baseDN内容" "(cn=目标用户)"`. The objectClass in the returned results is the list of available options
  personObjectClass: "inetOrgPerson"
  mapping:
    # The username field name of the login account in the authentication service; required. If the value does not exist, use email
    username: uid
    # The email field name of the login account in the authentication service; required
    email: mail
    # The mobile number field name of the login account in the authentication service; optional
    mobile: mobile
    # The unique identifier field name of the login account in the authentication service; required
    exterId: uid

Example configuration for accessing an LDAP service over the internal network without SSL enabled:

# LDAP client configuration (see https://ldap3.readthedocs.io/en/latest/server.html for the main configuration)
LDAPClientSet:
  # Whether to enable LDAP; disabled by default
  enable: true
  # The parameter format of server follows https://ldap3.readthedocs.io/en/latest/server.html
  server:
    # LDAP server domain name; can be a domain name, ldap://xxx, or ldaps://xxx
    # Local development address; bind in hosts: 172.16.211.111 openldap-server
    host: "<domain, protocol+domain+port>"
    # Specifies whether the server schema and server-specific information must be read (default: SCHEMA). See https://ldap3.readthedocs.io/en/latest/server.html#server-object for the available values
    get_info: "ALL"
  # Base DN information
  baseDN: "<base DN>"
  # The DN to bind with when the client establishes a connection
  bindDN: "<DN bound when the client establishes a connection>"
  # The password corresponding to bindDN
  bindPassword: "<password corresponding to bindDN>"
  # The attribute used to search for accounts
  searchAttribute: cn
  # The object class corresponding to the account information when searching for accounts. Note: if the counterpart is LDAP on Microsoft AD, configure according to the actual directory, e.g., person;
  # To confirm, install `ldapsearch` (a third-party LDAP connection tool) and run the command `ldapsearch -x -H ldap://xxx.cn:389 -D "bindDN信息" -w "bindPassword信息" -b "baseDN内容" "(cn=目标用户)"`. The objectClass in the returned results is the list of available options
  personObjectClass: "inetOrgPerson"
  # If the account attributes do not match the table below, adjust them accordingly
  mapping:
    # The username field name of the login account in the authentication service; required. If the value does not exist, use email
    username: cn
    # The email field name of the login account in the authentication service; required
    email: mail
    # The mobile number field name of the login account in the authentication service; optional
    mobile: mobile
    # The unique identifier field name of the login account in the authentication service; required
    exterId: cn

Using LDAP Single Sign-On

Once the above configuration has been added, you can use LDAP single sign-on.

1) Open the Deployment Plan login address and select LDAP Login on the login page;

2) Enter the username and password used on the LDAP server;

3) Log in to the corresponding workspace.

Further Reading

Feedback

Is this page helpful?