Gate
Gate is Kilimanjaro's Identity-Aware Kernel (IAK) — authentication, authorization, identity federation, and session management as a first-class platform primitive rather than a third-party plugin. The same primitive serves end-user sign-in, operator sign-in, and downstream RBAC enforcement; every record write the data plane accepts carries an identity proof that traces back to Gate.
1. Two consumption paths
| Path | Surface | Use when |
|---|---|---|
| Native | Gate runs in-platform alongside every project; identity primitives are reachable through @k9o/core (client.gate.*); secured by the platform's custody model; observable through the platform audit ledger | You're building on Kilimanjaro and want identity composed with the rest of the platform — Data, Compute, Controls, Kibo. The default. |
| Standalone | Gate ships as @k9o/gate — an Identity-as-a-Service SDK consumable independently of the rest of the platform | You want Kilimanjaro's identity substrate for an application that isn't otherwise on Kilimanjaro — replacing Auth0, WorkOS, Clerk, or Stytch as a focused Auth-as-a-Service. |
The wire contract and SDK shape are identical across both paths. Code written against @k9o/gate standalone runs unchanged against @k9o/core's Gate primitives when the application later adopts the rest of the Kilimanjaro platform.
2. Capability surface
Gate covers the full identity surface a production application needs:
| Category | Capabilities |
|---|---|
| Sign-in methods | Email + password; magic link; one-time passcode (email); social OAuth (Google / GitHub / Microsoft / Apple / etc.); enterprise OIDC; SAML 2.0; AD / LDAP native bridging; passkeys / WebAuthn |
| Multi-factor | TOTP (Google Authenticator / Authy / 1Password); WebAuthn (hardware keys + platform authenticators); recovery codes (10 single-use, mandatory at enrollment); step-up MFA for sensitive operations |
| Identity federation | Per-project identity-provider setup (Console); multi-tenant IdP routing; just-in-time provisioning; SCIM bidirectional sync for enterprise IdPs |
| Sessions | Two-tier model (root + tenant; see Session Model); rotating refresh tokens, revoked on sign-out or by revokeAllSessions; per-project access-token lifetime, inactivity timeout and maximum session length (see §8); configurable max-concurrent-sessions per user |
| Tokens | JWT issuance (EdDSA default; RS256 opt-in); per-project JWKS endpoint; extension plugin-token subtype |
| Transactional email | Triple-trigger pattern — platform-hosted default, customer SMTP override, fully customer-controlled link generation via generate*Link SDK shapes |
| Identity-aware enforcement | Every record write composes through the manifest-permission + JSON-policy two-layer gauntlet bound to the calling identity; identity is part of every audit-event envelope |
3. Native consumption
When Gate is composed under @k9o/core, calls flow through the k9o.gate namespace:
import { createClient } from '@k9o/core';
import { verifyJwt } from '@k9o/gate';
const client = createClient({
orgSlug: '<orgSlug>',
projectSlug: '<projectSlug>',
apiKey: process.env.K9O_API_KEY,
});
// Sign in
const accessToken = data.session.accessToken;
// Verify a JWT on a resource server (standalone helper, not a gate method)
const result = await verifyJwt({
token,
jwksUrl,
allowedAlgorithms: ['EdDSA', 'RS256', 'ES256'],
expectedIssuer: issuer, // the iss claim of your Gate tokens
expectedAudience: projectId, // end-user tokens: aud is the project id
});
if (result.valid) { /* result.claims.sub */ }
The full surface lives at API → Auth including the sign-in methods, the MFA flows, the identity-provider configuration, and the SessionPolicy primitives.
4. Standalone consumption (@k9o/gate)
The standalone SDK package is @k9o/gate, mirroring the @k9o/kibo standalone package for secrets. The shape is identical to the native path — same method signatures, same envelopes, same error catalogue — only the base URL and the absence of cross-pillar dependencies differ:
import { createGateClient } from '@k9o/gate';
const gate = createGateClient({
mode: 'standalone',
baseUrl: 'https://<orgSlug>.api.k9o.io',
projectSlug: '<projectSlug>',
});
const accessToken = data.session.accessToken;
const refreshToken = data.session.refreshToken;
const user = data.user;
Standalone Gate is priced by usage like the rest of Kilimanjaro, with every Gate capability available on every plan; see pricing.
5. Visual authoring — Gate Studio
Gate Studio is the visual authoring surface for Gate flows — sign-in screen designer, branded email templates, drag-and-drop auth-flow composition. Gate Studio is a Trailblazer-class extension that composes against the same Gate substrate; what you author in Gate Studio is bound to the same SDK-callable surface that any other Gate consumer reaches through gate.flows.*.
Authoring inside Gate Studio is one path; declarative configuration via the SDK / Console is another. Both produce the same runtime artifacts.
6. Enterprise SSO
Federate your workforce identity provider so your team signs in to Kilimanjaro with corporate credentials — native to Gate, no extension:
- Single sign-on with Okta
- Single sign-on with Microsoft Entra ID
- Single sign-on with Google Workspace
Each guide walks the same path: register the app, create the identity-provider config, exchange metadata, map attributes and groups to roles, enable lifecycle sync, and test.
7. Migrations
Migration paths from common Auth-as-a-Service vendors:
- Migrating from Auth0
- Migrating from WorkOS
- Migrating from Clerk
- Migrating from Stytch
- Migrating from Okta
Each migration page covers capability mapping, API-shape mapping, user-data migration, code walkthrough, and cutover checklist.
8. Session lifetime and sign-out
End-user sessions follow three per-project settings:
| Setting | Default | Range |
|---|---|---|
| Access token lifetime | 30 minutes | 5 to 60 minutes |
| Sign out after inactivity | 30 days | 1 hour to 90 days |
| Maximum session length | 90 days | 1 hour to 365 days |
- Refusal. A refresh the session no longer allows is refused with
K9O_SESSION_EXPIREDand areason:inactive,max_length,revokedorreplay. Witherrors: "redacted"an error dropsreason, so a client cannot tell a replayed refresh token from a revoked session. - Rotation. Each refresh returns a new refresh token and the one you sent stops working. Sending an old refresh token again ends the session. The SDKs keep the new token and refresh one call at a time.
- Password reset. Resetting an end user's password ends every existing session of that user. The session the reset opens stays.
- Sign out everywhere.
revokeAllSessionsends every session of the signed-in user, this device included. Access tokens already issued live until they expire.
Rotation and replay refusal, as one session's sequence:
9. Wrong-password limit
An account that collects too many wrong passwords has its password sign-in locked for a while. A sign-in during the lock answers 429 K9O_RATE_LIMITED with a Retry-After header, and recommendation.retryAfterSec says when to try again.
- The lock steps up. 15 minutes, then 1 hour, then 4 hours within a day.
- The answer is the same whether the account exists or not. A caller cannot use the lock to find out which email addresses have accounts.
- One budget per account. The Gate host and the API door share it for end users. The Console and the admin host share it for operators.
- A right password does not clear earlier failures, and during the lock it is refused with the same 429 as a wrong one.
- Other sign-in methods still work while the password is locked, where they are set up.
- End users: magic link, single sign-on, social sign-in, passkey, one-time code and password reset.
- Operators: magic link (where the membership allows it), organization single sign-on, social sign-in and Active Directory bind. On the admin host, Microsoft sign-in.
A client that gets the 429 should show the wait from Retry-After and offer one of the other methods, not retry in a loop.
10. See also
- API → Auth — full Gate SDK surface and HTTP contract.
- Enterprise SSO — federate Okta, Entra ID, or Google Workspace as your workforce identity provider.
- Session Model — two-tier session structure, exchange flow, MFA step-up.
- Project Selection & Access Requests — auth-flow lifecycle from email discovery to project landing.
- Gate Studio — visual authoring extension.
- Identity-Aware Kernel — architectural deep dive.
- Migration overview — four-phase migration arc applicable across all vendors.