What you will have at the end
The console bound to your Active Directory over LDAPS with the bind password stored sealed; one group, g8-editors, mapped to Editor on Staging and Viewer on Production; a member of that group signing in with the domain password, editing in Staging and reading in Production, where the Raw JSON tab is read-only, the edit page refuses, and a write sent past the console is answered 403 and recorded as Denied with the permission it needed. And a service account with a token that expires in ninety days, for the pipeline that promotes Routes.
This is about people who use the console. API callers that sign in with a directory password are a different mechanism, on the Route: Directory accounts as API callers. The two share the directory and nothing else. The console’s connection is set once for the whole install, under Users & access, and decides who may change the gateway; an authentication Plugin is set on each Route, with its own bind settings, and decides who may call that Route. A user who can sign in to the console cannot call a Route because of it, and the other way round.
Prerequisites
- A domain controller the console can reach over LDAPS and the CA that signed its certificate. The lab’s controller is a Samba Active Directory domain controller standing in for a Windows one, answering at
localhost:6636with test DNs; its certificate carries that name. - A read-only service account for the search, here
svc-g8-bind, and the base DNs of your people and your groups. - A role that administers the platform. The screenshots below were taken as
nora.becker.
Connect the directory
Open Users & access, the Directory tab, Set up connection. Under Servers, the domain controllers, tried in the order listed; the section says plain LDAP is not accepted. TLS is LDAPS on 636 or StartTLS on 389. CA certificate takes the PEM, and its help is the sentence a security reviewer looks for: the server name must match the certificate, and verification cannot be turned off. Under Bind account, the Bind DN and Bind password, stored sealed with the server key. Under Search, the User base DN and the Group base DN; users are matched by sAMAccountName or userPrincipalName, and groups are resolved through the transitive chain, so nested groups count, by the form’s help; this article used a direct member.
Test connection binds with what is typed and says what it found:

Save connection. The Directory tab now shows the connection with the CA’s subject and expiry, the bind DN, the password as set by whom and stored sealed, and the refresh rule: memberships are refreshed every five minutes while a user is signed in, and the last known ones are kept for an hour when the directory is unreachable. That is the tab’s own sentence; the hour was not put to the test here.
Map a group to a role
Under Group mappings, Add mapping. Directory group searches the directory as you type and shows the group’s DN; Role is one of the built-in roles or a custom one; Environment is where the role applies, or all Environments. The dialog says when it takes effect: members, nested groups included, get the role at their next sign-in or membership refresh.

The same group a second time, as Viewer on Production:

A member signs in
ahmet.yilmaz is a member of g8-editors and has never used the console. He signs in on the same page as a local user, with his domain account name and password, and lands on Staging: the navigation carries the Environment’s pages and nothing of the platform’s administration.

A Route in Staging shows Edit route and the Plugins tab, as it does for any Editor. The same kind of page in Production:

The Raw JSON tab opens, with a line above the editor: read-only, your role in Production cannot manage routes.

A deep link to the edit page, typed by hand, is refused on the page itself:

And a write sent to the API directly, with the Viewer’s own session, a PUT of the Route with a changed description:
HTTP 403
{"environment":"production","error":"forbidden","permission":"routes.manage","reason":"missing_permission"}
What the audit log keeps
That refused write is a record in Production’s audit log, access.denied, result Denied, with the actor, the source Active Directory, the permission the request needed and the route it tried.

The platform audit log holds the rest: directory.updated and directory.test for the connection, directory.group_mapping_added twice, and the sign-ins, auth.login_succeeded and, before it, one auth.login_failed with the reason directory_unreachable: the first attempt of this article timed out reaching the directory and the second went through, and both are there to read.
The user’s own page shows where the roles came from:

A service account for the pipeline
Users & access, the Service accounts tab, New service account: Name ci-deploy, used in the audit log, and the first assignment, Role Editor on Environment Staging; service accounts carry Environment roles only. On the account’s page, New token: a Name for the token list and the audit log, and Expires in, 30 days, 90 days, 180 days or a year, the longest allowed.

Create token. The token is shown once, with the words to remember: this is the only time it is shown, store it in your CI secret store now, send it as a bearer header, tokens in URLs are rejected. It is not in this article. The account page then lists it with its expiry and status, up to five active tokens per account, and expired and revoked tokens stay listed.

What to do next
- Give the pipeline something to promote: Promoting gateway configuration from staging to production.
- Let API callers sign in with the same directory, on the Route instead of the console: Directory accounts as API callers.
- Roles and access per Environment: API Gateway; the supported directory: Deployment; the solution page is Change control and audit.