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_dnand 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
-
Add the service account password to
.env:LDAP_BIND_PASSWORD=<service account password> -
Add the source under
auth.providersinconfig.yaml. Theconfig.yamlin 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 -
Run
docker compose up -dand thendocker compose restart. -
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
| Setting | Default | Description |
|---|---|---|
url | Required | ldaps://host:636, or ldap://host:389 with start_tls: true |
start_tls | false | Use StartTLS on port 389 |
insecure_skip_verify | false | Skip domain controller certificate verification. Use only for testing |
bind_dn, bind_password | Read-only service account | |
base_dn | Required | Where 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_username | sAMAccountName | User name attribute |
attr_display_name | displayName | Display name attribute |
attr_email | mail | Email attribute |
attr_groups | memberOf | Group attribute |
include_ou | false | Treat the user's OU as a group too, so departments can be mapped directly to OUs |
timeout | 10s | Connection 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 nameOps. Withinclude_ouon, the external key can also be an OU. - Company admins: a person whose groups match any entry in
auth.admin_groupsbecomes 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.
Configuration reference
What each entry in .env and config.yaml in the installation directory does, how changes take effect, and the settings needed to serve the portal behind an HTTPS reverse proxy.
Single sign-on
Sign in to RST Index with OIDC, CAS 3.0 or SAML 2.0. Addresses to register with the IdP, config.yaml settings, and mapping groups to departments and admins. Enterprise feature.