Skip to main content

Sign in with Active Directory and map its groups to G8 roles

Bind the console to Active Directory over LDAPS, map a group to Editor on Staging and Viewer on Production, the Viewer refused and audited, and a CI token.

By Akif F. Güven Getting started

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:6636 with 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:

The Connect Active Directory form with the banner Connection test passed: bound to localhost:6636 in 183 ms as the bind DN, the certificate chain valid for the host name, both base DNs read; below it Servers holding localhost:6636, TLS LDAPS, the CA certificate pasted, and the Changes panel with bind_password as four dots Three facts before you save: the bind worked, the certificate matched the name, both base DNs are readable. The DNs are the lab’s test DNs, and the breadcrumb names this form Edit connection even on the first setup.

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 Add group mapping dialog: Directory group g8-editors, Role Editor, Environment Staging, and the note that Platform administrator needs no environment One group, one role, one Environment. The same group can carry a different role elsewhere.

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

The Group mappings list: g8-editors with its DN mapped to Editor on Staging and to Viewer on Production, both added 14 Oct 2026, with a remove control per row Editor where the team works, Viewer where it only watches. Membership in the directory decides who; the mapping decides what.

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.

The console's left navigation as the directory user sees it: the Environment switcher on Staging, Overview, the gateway pages, and under Administration only Environments and Help & about, with no Users & access What a non-administrator sees. The Environment switcher offers Staging and Production, the two his group is mapped on.

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

A Route page in Production as the Viewer: the name, Overview, Plugins and Raw JSON tabs, the Matching and Target cards, and no Edit route button The same page, one button fewer. What a Viewer may not do is not drawn.

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

The Raw JSON tab of the Production Route as the Viewer, with the note Read-only. Your role in Production cannot manage routes, and the object below it Read, not write. The Raw editor shows the object and takes no edit.

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

The edit page of the Production Route as the Viewer: a lock icon, You cannot manage routes in Production, the sentence that the role can view routes but not create or change them, and a Back to routes link The page says why and what to ask for. Nothing was sent to the server.

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 audit record Access denied · Denied: action access.denied, reason missing_permission, actor ahmet.yilmaz from Active Directory with his session id, the target Environment production, and under Request the IP address, the permission routes.manage and the route PUT /api/environments/{id}/gateway/routes/{rid} Who tried what, and which permission was missing. The record exists because the server refused; the console never had to.

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:

The user page of Ahmet Yilmaz: source Active Directory, the directory identity with the UPN and the DN, password managed by Active Directory, and under Access two rows, Production Viewer and Staging Editor, each granted via Group g8-editors, with the sync time and the five-minute refresh under them Granted via the group, not by a person. Take him out of the group in the directory and the roles go at the next refresh.

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.

The New token dialog for ci-deploy: Name deploy-2026q4, Expires in with 90 days chosen and the sentence Expires 12 Jan 2027, the longest allowed is 1 year A token always expires. A year is the ceiling, and the date is written out before you create it.

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.

The ci-deploy service account page: Details with the description and created by nora.becker, Tokens with deploy-2026q4 created 14 Oct 2026, expires 12 Jan 2027, never used, Active, with a Revoke control, and Access with Staging Editor granted direct One token, one role, one Environment. Revoke is the control beside the token; it was not used here.

What to do next

Written by
Akif F. Güven
Engineer, G8
Was this helpful?
Next step

See G8 in a demo

We’ll show you the console with APIs and AI traffic like yours, and answer the questions these articles leave open.

  1. 01Demo
  2. 02Proof of conceptOn Docker for a quick start, or on the infrastructure you plan to run G8 on.
  3. 03LicenseWe prepare a quote for your edition and nodes, and you receive a signed license file.