LDAP / Active DirectoryOverview

§ 06 · LDAP / ACTIVE DIRECTORY

LDAP / Active Directory

People sign in to HiveCFM with the same username and password they use for Windows. HiveCFM asks the company directory, every time.

Many customers, banks especially, do not want a separate HiveCFM password. Their staff already have a company account in Active Directory (AD), Microsoft’s user directory. When LDAP sign-in is on, HiveCFM checks the username and password against that directory instead of its own user table.

LDAP (Lightweight Directory Access Protocol) is the language programs use to talk to a directory. Active Directory speaks it, and so does OpenLDAP. In this section, “the directory” means the customer’s AD or LDAP server, and “DC” (domain controller) means one AD server.

This section is for support and delivery engineers who set the feature up at a customer, and for developers who need to know exactly what the code does. Every rule here comes from the code in apps/web/modules/auth/ldap/. If this page and the code ever disagree, the code wins: tell us and we will fix the page.

What it does, in one list

  • Checks passwords against the directory. The password is checked live, on every sign-in. HiveCFM never decides on its own that a password is right.
  • Creates the HiveCFM user on first sign-in (unless an owner already added them from the directory). Email and name come from the directory. Nobody has to create accounts by hand.
  • Signing in gives no access by itself. A directory user nobody has added lands on a “No workspace found” page until an admin adds them. See Giving users access.
  • Lets owners add people before they sign in. Add from directory on Members & Teams searches the directory and gives a person their role and workspaces up front; their access starts at their first sign-in. See Add from directory.
  • Locks the login page to the directory. While LDAP is on, the login page shows only username and password. Sign-up, single sign-on (SSO) buttons and “forgot password” disappear, and the server refuses them too.
  • Keeps one way in for the administrator. A small “Administrator sign-in” link lets an owner of any organization sign in with a local HiveCFM password, for example when the directory is down.

What it does not do

⚠️

It is authentication only. HiveCFM does not read AD groups and does not map groups to roles, teams or workspaces. Being in an AD group like “HiveCFM Users” changes nothing in HiveCFM. An admin gives each person access inside HiveCFM. If a customer wants to limit who may sign in at all, that can be done with the user filter (see Operations).

Not includedWhat that means in practice
Group → role mappingAccess is granted by an admin in HiveCFM, one person at a time (before their first sign-in with Add from directory, or after it from the waiting card).
Directory syncHiveCFM only learns about a person when they sign in, or when an owner adds them one at a time with Add from directory. There is no nightly import and no automatic removal.
Several directoriesOne LDAP configuration per HiveCFM instance.
Kerberos / Windows “Negotiate”HiveCFM sends a username + password bind over an encrypted connection (LDAPS or StartTLS). Node.js cannot do Windows integrated authentication.
Single sign-onUsers still type their password into HiveCFM. There is no “already signed in to Windows, so skip the form”.
An offline fallbackIf the directory is unreachable, directory users cannot sign in. HiveCFM does not fall back to a stored password.

Who can configure it

LDAP is an instance-wide setting: one configuration for the whole HiveCFM installation, not one per organization.

Any owner of any organization on the instance can open Organization settings → LDAP and change it. Managers and members cannot.

  • The page says so plainly: “This setting applies to every organization on this instance.” Save opens a confirmation, “Save LDAP settings for all organizations?”, with the button Save for all organizations.
  • On a normal single-customer install there is one organization, so nothing changes in practice: its owners are the people who manage LDAP.
  • On an instance with several organizations, an owner of any of them can change how people sign in to all of them, including where passwords are sent. That is a deliberate product decision; give owner rights only to people you would trust with sign-in for the whole instance. Per-organization LDAP is a planned follow-up.
  • Every LDAP server action checks the owner role again on the server. Hiding the page is not the protection; the check is.

The big picture

What each box does:

BoxRole
BrowserShows the login form. The password travels to HiveCFM over HTTPS, like any login.
HiveCFM coreTalks to the directory, decides yes or no, creates or updates the HiveCFM user, starts the session.
Domain controllerThe only place where the password is really checked.
instance_ldap_configOne database row (id instance-ldap-config) with the whole configuration. The service-account password in it is encrypted with the instance ENCRYPTION_KEY. It is never sent back to the browser.
User tableHolds the directory users HiveCFM has seen, marked identityProvider = 'ldap', with the directory’s unique id (objectGUID).

The lifecycle

From an empty server to people working. Each step links to the page with the detail.

#StepWhoDone when
1First run: open /setup, create the first local owner account and the first workspace.Delivery engineerYou can sign in with a local email + password. Keep this account; it is your way back in.
2Collect the inputs: server name, Base DN, service account and its password, the CA certificate, one real test user.Customer ITYou have every value in the Setup guide checklist.
3Configure: Organization settings → LDAP. Fill Connection and Directory.An organization ownerRequired fields show ✓.
4Test: run Test connection, then Test user credential with a real person.An organization ownerBoth tests pass for the current values.
5Save with the switch on and confirm Save for all organizations. The server repeats both tests before it writes anything.An organization owner”LDAP sign-in enabled…”. Everyone is signed out, you too.
6Admin signs back in with Administrator sign-in (local password).An organization ownerYou are in again.
7Admin grants access, either way: before they sign in with Add from directory (owners), or after their first sign-in from Directory users waiting for access (owners and managers).Owner or managerThe person has a role and workspaces.
8Users sign in with their company account.Each personPeople added in advance land straight in their workspace. Anyone not added yet sees “No workspace found” and appears in the waiting card.

LDAP cannot bootstrap a fresh instance. The first organization must be created by a local email account (step 1) before LDAP is switched on. Never delete that local owner afterwards: it is the break-glass account.

What changes for users when LDAP is on

Before (LDAP off)After (LDAP on)
Login page: email + password, maybe SSO buttons, “forgot password”, “sign up”.Login page: “Sign in with your company account” — username + password only, and a small “Administrator sign-in” link.
People type their email address.People type jane.smith, EXAMPLE\jane.smith or jane.smith@bank.example. All three work.
HiveCFM checks its own stored password.The directory checks the password, every time. A password changed in Windows works in HiveCFM at once; the old one stops working.
Anyone can sign up (if sign-up is enabled).Sign-up is closed. /auth/signup shows a not-found page and the sign-up action is refused.
Local users sign in normally.Only organization owners (of any organization) can still use a local password (the Administrator sign-in). Other local accounts are refused. LDAP users never use a local password.
—Switching LDAP on or off signs everyone out once.

Read in this order

Set it up

  • Setup guide — the settings page, field by field, with annotated screenshots (markers 1–22 and 36–39).
  • Migrating from old HiveCFM — turning the old web.config LDAP keys into the new fields, and what changes moving from Windows/IIS to a Linux container.

Understand it

  • How sign-in works — one login, step by step: search, bind, user creation, refusals, rate limits, logs.
  • Giving users access — the two ways in (before and after the first sign-in), the “Directory users waiting for access” card, roles, workspaces and the teams it creates.
  • Add from directory — search the directory and give people access before they sign in, with annotated screenshots (markers 23–33), statuses, first sign-in and audit events.
  • Security and sessions — server-side enforcement, session sign-out, break-glass, encryption, and the design rulings in plain language.

When something goes wrong

  • Troubleshooting — every error code with its fix, symptom → cause, and SQL to inspect users.

Day two

  • Operations — rotating the service password, renewing the CA, the kill switch, turning LDAP off, deploying the migrations, and customising the user filter.

HiveCFM Developer Hub — internal team guide