Skip to main content
Installation

AD/LDAP

Sign in to RST Index with AD or LDAP accounts. Configure a read-only service account in config.yaml, and sync department membership and admin rights from memberOf and OUs. Standard feature.

AD/LDAP sign-in is part of the Standard Edition. Staff choose the directory's button on the sign-in page and enter their directory account and password. The portal uses a read-only service account to find the user with a filter, verifies the password by binding with the user's DN, and then reads the user's groups.

AD/LDAP sources are configured in config.yaml. The admin console has no settings page for them.

Prerequisites

  • A read-only service account that can search for users under base_dn and read group attributes. No callback URL needs to be registered.
  • The portal server can reach the domain controllers on port 389 (ldap, StartTLS) or 636 (ldaps).

Configuration

  1. Add the service account password to .env:

    LDAP_BIND_PASSWORD=<service account password>
  2. Add the source under auth.providers in config.yaml. The config.yaml in the package contains a commented-out example:

    auth:
      admin_groups:
        - "NavAdmins"
      providers:
        - id: local
          type: local
          name: Local account
        - id: corp-ad
          type: ldap
          name: Domain account
          ldap:
            url: "ldaps://dc01.corp.local:636"
            start_tls: false
            insecure_skip_verify: false
            bind_dn: "CN=svc-nav,OU=Service,DC=corp,DC=local"
            bind_password: "${LDAP_BIND_PASSWORD}"
            base_dn: "DC=corp,DC=local"
            user_filter: "(&(objectClass=user)(sAMAccountName={username}))"
            attr_username: sAMAccountName
            attr_display_name: displayName
            attr_email: mail
            attr_groups: memberOf
            include_ou: true
  3. Run docker compose up -d and then docker compose restart.

  4. Open the sign-in page, check that a Domain account button appears, and sign in with a directory account.

Keep the local source. The local admin account is there for emergency access and can always sign in, even when the licence has lapsed.

Settings

SettingDefaultDescription
urlRequiredldaps://host:636, or ldap://host:389 with start_tls: true
start_tlsfalseUse StartTLS on port 389
insecure_skip_verifyfalseSkip domain controller certificate verification. Use only for testing
bind_dn, bind_passwordRead-only service account
base_dnRequiredWhere the user search starts
user_filter(&(objectClass=user)(sAMAccountName={username}))Filter used to find the user. {username} is replaced with the escaped account name entered
attr_usernamesAMAccountNameUser name attribute
attr_display_namedisplayNameDisplay name attribute
attr_emailmailEmail attribute
attr_groupsmemberOfGroup attribute
include_oufalseTreat the user's OU as a group too, so departments can be mapped directly to OUs
timeout10sConnection and query timeout

For the settings common to all sources, id, name and trust_email, see Configuration reference.

Department and admin sync

Each time someone signs in, the portal uses the groups returned by the directory to sync department membership and admin rights:

  • Departments: the external key of each department under Organisation and accounts > Departments in the admin console is compared with the person's groups, case-insensitively. Separate several values with ;. A group in DN form (CN=Ops,OU=Groups,DC=corp,DC=local) matches either the full DN or the CN name Ops. With include_ou on, the external key can also be an OU.
  • Company admins: a person whose groups match any entry in auth.admin_groups becomes a company admin.
  • Sign-in sync only adds and removes memberships and admin rights that came from sync. Members added manually in the console, department admin roles and company admins set manually are not affected.
  • Each source only changes the memberships it granted, so someone who alternates between AD and another source does not see their memberships flip.

Known limitations

  • Accounts disabled in the directory stop working only when their session expires (12 hours by default), because the portal does not query the directory again.
  • By default, a person who signs in with AD and with another source has two accounts. They can link the identities themselves under Account and sign-in, or an admin can merge them on the Users page. See Organisation and accounts.

On this page