GatelitClient calls getToken() before every request. What that function returns determines how the gateway identifies and authorizes the request. Three schemes are available — pick the right one for your deployment.
Service keys (GatelitKey)
Long-lived keys for backend use. Create them in the dashboard under Settings → Service Keys.
Signed tokens (GatelitSigned)
Your backend exchanges a service key for a short-lived HMAC-signed JWT. The gateway verifies it without a database call.
Backend — exchange a service key for a signed token:
OIDC tokens (Bearer)
OIDC authentication is in Alpha. Full self-serve configuration is coming soon.
Contact us if you need OIDC support today.
Caching tokens
getToken is called before every request. Add caching to avoid unnecessary work: