Skip to main content

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​

PathSurfaceUse when
NativeGate 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 ledgerYou're building on Kilimanjaro and want identity composed with the rest of the platform — Data, Compute, Controls, Kibo. The default.
StandaloneGate ships as @k9o/gate — an Identity-as-a-Service SDK consumable independently of the rest of the platformYou 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:

CategoryCapabilities
Sign-in methodsEmail + 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-factorTOTP (Google Authenticator / Authy / 1Password); WebAuthn (hardware keys + platform authenticators); recovery codes (10 single-use, mandatory at enrollment); step-up MFA for sensitive operations
Identity federationPer-project identity-provider setup (Console); multi-tenant IdP routing; just-in-time provisioning; SCIM bidirectional sync for enterprise IdPs
SessionsTwo-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
TokensJWT issuance (EdDSA default; RS256 opt-in); per-project JWKS endpoint; extension plugin-token subtype
Transactional emailTriple-trigger pattern — platform-hosted default, customer SMTP override, fully customer-controlled link generation via generate*Link SDK shapes
Identity-aware enforcementEvery 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 { data } = await client.gate.signIn({ email: '[email protected]', password: '...' });
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 { data } = await gate.signIn({ email: '[email protected]', password: '...' });
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:

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:

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:

SettingDefaultRange
Access token lifetime30 minutes5 to 60 minutes
Sign out after inactivity30 days1 hour to 90 days
Maximum session length90 days1 hour to 365 days
  • Refusal. A refresh the session no longer allows is refused with K9O_SESSION_EXPIRED and a reason: inactive, max_length, revoked or replay. With errors: "redacted" an error drops reason, 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. revokeAllSessions ends 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:

ClientGatesignInaccess token + refresh tokenrefresh, sending the refresh tokennew refresh token; the one sent stops workingrefresh, sending the old refresh token againsession ends: K9O_SESSION_EXPIRED, reason replay
Each refresh rotates the refresh token; presenting a retired one ends the session.

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​