Skip to content
Operate

LDAP and Active Directory

Sign in with directory accounts through an identity provider that bridges LDAP or Active Directory to OIDC or SAML.

On this page

The engine does not bind to LDAP itself. It signs people in through an identity provider, and the identity provider reads your directory. That keeps directory credentials out of the engine, and gives directory accounts MFA and a single place to offboard. Mirth Connect and Rhapsody bind to LDAP directly; with MedHook you put a bridge in between.

flowchart LR
    AD["Active Directory / LDAP"] -->|LDAP or agent| IDP["Identity provider\n(Entra ID, Okta, Keycloak, AD FS)"]
    IDP -->|OIDC or SAML| ENG["MedHook engine"]

Pick a bridge

You runBridge
AD with Microsoft 365Entra Connect (or Cloud Sync) already syncs users and groups to Entra ID. Follow Microsoft Entra ID.
AD with OktaThe Okta AD agent (or LDAP agent for other directories) imports users and groups. Follow Okta.
AD on premises, no cloud IdPAD FS issues SAML or OIDC from AD. Follow SAML 2.0.
OpenLDAP or another directoryKeycloak with an LDAP user federation, next to the engine. Follow Any OIDC provider.

Keycloak with LDAP

  1. Run Keycloak in your network and create a realm, for example healthcare.
  2. Under User federation, add an LDAP provider: the connection URL, bind DN and the users DN. Set Edit mode to READ_ONLY so Keycloak never writes to the directory.
  3. Add a group-ldap-mapper for the groups DN, so directory groups become Keycloak groups.
  4. Create a confidential OIDC client medhook-engine with the redirect URI https://engine.example.test/api/auth/sso/oidc/callback, and a Group Membership mapper that adds groups to the ID token (turn off Full group path).
  5. Configure the engine:
bash
ENGINE_OIDC_ISSUER=https://keycloak.example.test/realms/healthcare
ENGINE_OIDC_CLIENT_ID=medhook-engine
ENGINE_OIDC_CLIENT_SECRET=<from your secrets manager>
ENGINE_OIDC_GROUP_ROLES="medhook-admins=admin;medhook-operators=operator"

Disabling an account in the directory stops new sign-ins at once. A session already open ends after 60 minutes without activity, or 12 hours after sign-in at most; run create-engine-user <email> --disable to end it sooner.

Reference