Skip to content
GatewayMarkdown

Protect APIs

Run the gateway in front of an API, so every request is checked for its token, revocations and policies before your API sees it.

You run the gateway beside your API, and callers call the gateway instead. It verifies each caller’s token against the realm’s keys, refuses anything the realm has revoked, decides the request against your policies, and forwards only an allow, with the verified caller named in a header your API can trust. A refused caller is told what would help: where to get a token, which scopes would pass, or that a stronger sign-in is needed.

Tokens can be held tighter still. A token bound to a key or a certificate is taken only from the client that holds it, and with token swap your API receives a fresh token meant for it alone, never the caller’s.

CapabilityWhat it gives you
Run the gatewayA proxy in front of your API that checks, decides and only then forwards (with limits: HTTP/1.1 behind your TLS front end, one API per gateway, fixed timeouts)
Behind your own proxyAn external-authorization check your existing proxy calls, with the same verdict
Token checks offlineEvery token verified against the realm’s keys, with no call per request
Revocations honoredRevoked tokens, stopped agents and taken-back delegations refused within one poll
Groups asked of the realmA policy about the caller’s groups is decided by the realm, never guessed
Gateway configurationEvery setting, from the environment, with its default
Run it in productionA container you run beside your API, as many replicas as you need (with limits: the image isn’t published yet, and there’s no packaged deployment)
CapabilityWhat it gives you
Requests and refusalsA refusal says where to sign in and which scopes would pass
Resource metadataClients find which realm protects the API, and where to sign in
Step-upA request that needs a stronger sign-in is told so, and the app asks the user
Verified caller headerYour API reads the verified caller from x-agent-id, which a client can’t forge
Safe pathsA path your API might read differently is refused before anything else
CapabilityWhat it gives you
Bound tokens at the gatewayA token bound to a key is taken only with a fresh proof from that key
Certificate-bound tokensA token bound to a client certificate is taken only over that certificate
Token swapEach allowed call goes on under a token meant for its API, never the caller’s (with limits: one API per gateway)

The gateway is a container you run yourself; there’s no hosted gateway, and its image isn’t published yet.

See What’s next for protecting APIs: