Single sign-on for your other tools

Your own services trust the gateway. The tools around them do not: Grafana, Argo CD, the management console of a message broker, a database UI each come with their own accounts and their own sign-in form, and an administrator who creates the users by hand and forgets to remove them. People sign in five times a day, and someone who leaves has one access closed out of five.

Meerkat signs people in once, at the gateway, and tells each tool who they are in the form that tool already understands. No plugin and no fork: a setting on the tool's side, a route on Meerkat's.

Enterprise edition. Meerkat as an OpenID provider is Enterprise. Headers, REMOTE_USER, the signed JWT, answers from a template and publishing a tool under a path are in the Community edition.

Meerkat as the tools' OpenID provider

Many tools know one way to hand sign-in over: send the person to an OpenID Connect provider and read the tokens it returns. Meerkat is that provider for the applications behind its routes. The person is already signed in at the gateway, so they go through without seeing a page, and the tool receives standard tokens - an ID token, an access token and a refresh token - signed with the gateway's keys.

A route bound to a client, the claims its tokens carry and what each says for the person editing

Before anyone uses it, a sign-in can be tried for any person from the console: the route that lets them in, those that turn them away, and the claims of each token, without issuing anything.

A sign-in tried for one person: the route that lets them in, and the ID token's claims

The other contracts

Not every tool speaks OpenID Connect, and many need less. A route tells the service behind it who is calling, in the form that service reads:

The tool expects The route sends
a "trust the proxy" header, like Grafana's or GeoServer's one header per fact, under the names the tool reads
REMOTE_USER, the name older applications read REMOTE_USER and X-Remote-User, the second for the proxies that drop underscores
a bearer token it verifies a short signed JWT on every request, ES256, EdDSA or RS256, with keys published and rotated without downtime
a "who is signed in" endpoint of its own an answer the route builds from a template on the caller's identity, in the format the tool expects

A route handing the person over as a signed JWT: the Identity preview shows the Authorization header the service receives, signed ES256 by the gateway's key, and its claims decoded

The facts sent are chosen and renamed per route: username, id, full name, e-mail, tenant, time zone, locale, roles. The same values arriving from outside are removed first, so a caller can never claim to be somebody else.

The Identity section of a Grafana route: the facts ticked, each renamed to the header Grafana reads, the roles reduced by an expression to the one value it wants

The template is how a tool's identity contract is configured rather than coded. A tool that asks /user and expects a name and a list of authorities gets them from a route that answers by itself:

filters:
  - type: respond
    args:
      body: '{"name": {{json .Username}}, "authorities": {{json (wrap "authority" .Roles)}}}'
      contentType: application/json; charset=utf-8
A tool that trusts a header must be reachable only through the gateway: no published port, no ingress of its own. Whoever reaches it another way is trusted the same.

Under a path, without rebuilding it

Off-the-shelf tools rarely expect to live under /grafana/. A route publishes one under a path as it is: the page's base address and the redirects it sends are rewritten on the way back, which is enough for a tool with relative links, the RabbitMQ console for one. For a tool written for the root, one switch also rewrites the addresses in its pages, its stylesheets and its script calls, and the route lists the requests that still escape its path.

A tool that loads a font or a script from a CDN it cannot reach, offline above all, gets it from a route that serves files you upload.

Go further