LDAP integration
Configure Active Directory or OpenLDAP for password sign-in and restrict access to one directory group.
Select LDAP at bootstrap step 3 to let users sign in with their directory login ID and password. AI Gateway supports Active Directory and OpenLDAP. Members of the configured access group, including nested members, can sign in.
Direct LDAP sign-in does not provide MFA or password reset. If MFA is required, connect the directory to an OIDC identity provider, such as Keycloak with LDAP federation, and configure that provider in AI Gateway instead.
Prepare the directory
Section titled “Prepare the directory”- Create a service account with permission to search users and read their identifiers, login attributes, email attributes,
uid,displayName, andcn. Active Directory requiresobjectGUID; OpenLDAP requires the operational attributeentryUUID. - Give that account permission to read the access group and nested groups. OpenLDAP also requires reading rootDSE
namingContextsand searching group membership throughout the naming context containing the access group. - Create one access group and add the users or nested groups that may sign in. Include the first administrator.
- Ensure each user has a value in at least one configured email attribute. The first administrator’s selected email must match the email entered at bootstrap.
- Restrict changes to these email attributes with directory ACLs. Users must not be able to assign themselves another user’s email: the first administrator is selected by this value.
Values to enter
Section titled “Values to enter”| Field | Value |
|---|---|
| Directory type | Active Directory or OpenLDAP. This cannot be changed after installation because it determines user identity. |
| Server URL | ldaps://directory.example.com:636, or ldap://directory.example.com:389 for mandatory StartTLS. Default ports are 636 and 389. Do not include credentials, a search path, query, or fragment. |
| Bind DN | Full DN of the service account, for example cn=gateway-reader,ou=services,dc=example,dc=com. |
| Bind password | Service account password. Required for every save, including later changes. |
| User search base DN | Subtree containing every user who may sign in, for example ou=people,dc=example,dc=com. |
| Login ID attribute | Defaults to sAMAccountName for AD and uid for OpenLDAP. Enter one attribute name, not a filter. |
| Email attributes | 1-5 comma-separated attribute names in priority order. AD suggests mail, userPrincipalName; OpenLDAP suggests mail. The first nonempty value is used. Duplicates are rejected. |
| Access group DN | Full DN of the group allowed to sign in. |
| CA certificate (PEM) | Optional additional trusted CA certificates. Paste one or more PEM certificate blocks when using an internal CA or a self-signed server certificate. Leave empty for system roots only. |
The server certificate must match the URL host, including an IP SAN when connecting by IP. Certificate verification cannot be disabled. AI Gateway connects directly without HTTP proxies; private addresses are allowed, cloud metadata addresses are refused. The Gateway host must be able to reach the directory port.
Saving settings validates their format without contacting LDAP. The first connection occurs at sign-in. LDAP does not need an OAuth application, client ID, client secret, or callback URL.
Access group rules
Section titled “Access group rules”| Directory | Membership |
|---|---|
| Active Directory | Direct and nested membership using AD’s matching rule in chain. AI Gateway does not impose a 10-level limit. |
| OpenLDAP | groupOfNames.member, groupOfUniqueNames.uniqueMember, and posixGroup.memberUid. Up to 10 group levels; cycles stop at already visited groups. |
For posixGroup, memberUid contains the user’s uid, even when another attribute is used to log in. A posixGroup can be a member of a groupOfNames. Primary group membership derived only from AD or POSIX primary-group fields is not supported; membership must appear in the supported group attributes.
For OpenLDAP, configure equality indexes on member, uniqueMember, and memberUid, and on the configured login attribute. Search permissions and indexes must cover the naming context searched for parent groups. The complete directory verification has a 10-second deadline.
Removing someone from the access group prevents their next sign-in. Existing sessions remain valid. Renaming or moving an entry preserves identity through its GUID, provided it remains inside the search base and access group. Existing members’ stored email and name are preserved at sign-in; changing directory profile values does not update them through this login flow.
Complete setup and maintain settings
Section titled “Complete setup and maintain settings”After Create organization, enter the first administrator’s login ID and password on the completion screen. A successful sign-in opens /admin. If the browser was closed, use /login.
After installation, open Auth providers and modify LDAP settings. Directory type and the internal identity boundary remain fixed. Enter the bind password again for every save. Keep the user and group DNs, email permissions, and CA consistent with the directory.
Failed attempts and troubleshooting
Section titled “Failed attempts and troubleshooting”Five invalid-credential results for the same normalized login ID block further directory attempts until 5 minutes after the first failure. The fifth attempt returns the credential error; following attempts show the remaining wait. For example, failures at 00:00 and 04:59 still expire at 05:00. A successful sign-in clears the counter. Whitespace and case differences do not create separate counters.
Concurrent attempts for the same ID are rejected without waiting or contacting LDAP. Retry manually after the current attempt finishes. Directory outages, missing access-group membership, and inactive Gateway accounts do not increase the credential-failure counter.
This limit does not guarantee that AD accounts cannot lock. Review the AD lockout threshold, Reset account lockout counter after, failures from other clients, and Redis state loss together. A threshold of 6 is insufficient by itself: when AD retains failures for 30 minutes, the sixth failure after Gateway’s 5-minute window can lock the account.
| Symptom | Check |
|---|---|
| Login ID or password is incorrect | Login attribute, unique search result, password, account lockout, or expired password. Password change requirements also appear as credential errors. |
| Account is not in the access group | Group DN, supported membership attributes, service account read permissions, and OpenLDAP depth. |
| Account is not authorized | Identifier and email attributes; for first administrator login, verify the selected email matches bootstrap. |
| Sign-in failed | TLS trust and hostname, StartTLS support, network access, service credentials, directory response time, and Redis availability. |
Server failure logs include a reason and sanitized LDAP result or AD subcode when available. Login success and failure are not Activity Log events. Configuration changes are recorded there without storing passwords in the event.