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.
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 client declared once, in the console: its id, and a secret drawn by Meerkat, given by the application, or none for browser code using PKCE. On Kubernetes, the application's secret can be read from the Secret its own deployment writes, so a rotation on its side is all it takes.
- No redirect address to type: the code only goes back under the path of a route bound to that client.
- Who may sign in is the route's access rule, the one that already guards the tool. Two levels, administrators and readers, are two routes on the same paths with the same client, each sending its own claims; the first route that lets the person in decides.
- Rights follow at every refresh: a role removed, a tenant left or a route turned off apply to the next tokens, not at the next sign-out, and the tokens end with the gateway session.
- A tool inside the cluster exchanges its codes and reads the keys on the gateway's internal address, so it does not depend on the public name.

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.

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 |

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 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
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
- Meerkat as an OpenID provider: the client, the route, the claims, two levels of access, signing out.
- Connecting an application: Grafana and GeoServer by headers, RabbitMQ and DbGate through the OpenID provider.
- The identity JWT: what a service receives and how it verifies it.
- Fitting an application: the path, the address, the identity, the roles.
- respond and files, in the filters reference.
- Replace an authentication proxy.