Authentication
Token exchange, introspection, and identity lookup. For conceptual overview see Authentication.
ScaiVault delegates identity to ScaiKey. Most auth endpoints live on ScaiKey; ScaiVault exposes a thin layer for token introspection and context discovery.
Base path: /v1/auth/
GET /v1/auth/whoami#
Identify the caller from the bearer token. Useful for debugging — shows you who ScaiVault sees you as.
1 2 | |
Response:
1 2 3 4 5 6 7 8 9 10 11 12 | |
Required: authenticated.
POST /v1/auth/introspect#
Validate a token without using it. Common in gateway/proxy scenarios.
1 2 3 4 | |
Response:
1 2 3 4 5 6 7 8 9 | |
If the token is invalid or expired: {"active": false} with HTTP 200.
Required: admin scope.
POST /v1/auth/exchange#
Exchange a foreign token (workload identity from Kubernetes, AWS, GCP, etc.) for a ScaiKey-minted ScaiVault token. Used by services that don't have static credentials.
1 2 3 4 5 6 7 8 9 | |
Response:
1 2 3 4 5 6 | |
Configure the trust relationship (which foreign issuers to accept, how to map to ScaiKey identities) in the admin UI under Access → Token Exchange.
Required: none (the subject token authenticates).
Credentials: bearer tokens and API keys#
ScaiVault accepts two credential types, and they go in different headers:
| Credential | Header | Used by |
|---|---|---|
| ScaiKey JWT | Authorization: Bearer <jwt> |
human sessions, OAuth clients |
ScaiVault API key (key_…) |
X-API-Key: key_… |
service accounts, the CLI, the certificate agent |
An API key sent as a bearer token is rejected — the server tries to parse it as a JWT and fails with Not enough segments. All three SDKs detect a key_ prefix and route it to the correct header automatically, so passing either as token works.
Scopes#
Scopes constrain service accounts. Human users authenticated through the admin UI bypass scope checks, on the basis that the UI login is itself the control — so adding a scope to an endpoint restricts machine callers, not people. Where that is too weak, an endpoint carries an explicit role check as well (certificate private-key export is the current example).
| Category | Scopes |
|---|---|
| Secrets | secrets:read secrets:write secrets:delete secrets:list |
| PKI | pki:read pki:write pki:delete pki:export-key |
| ACME | acme:read acme:write acme:delete |
| DNS | dns:read dns:write dns:delete |
| Dynamic secrets | dynamic:read dynamic:write |
| Rotation | rotation:read rotation:write |
| Policies | policies:read policies:write policies:delete |
| Secret policies | secret_policies:read secret_policies:write |
| Webhooks | webhooks:read webhooks:write |
| Subscriptions | subscriptions:read subscriptions:write |
| Service accounts | service_accounts:read service_accounts:write service_accounts:delete |
| Identity | identity:read identity:* |
| Roles | roles:read roles:write roles:delete |
| Audit | audit:read |
| Operations | admin:read |
Wildcards work per namespace: secrets:* grants every secrets: scope, and * grants everything. A namespace wildcard does not cross namespaces — secrets:* grants no PKI access.
pki:export-key is separate from pki:write on purpose. Exporting a stored private key takes the key material outside ScaiVault's boundary, so it needs its own grant, is audited on every call, and additionally requires an administrator role for human callers.
OAuth flows on ScaiKey#
Everything else — authorization code + PKCE, client credentials, refresh token rotation — happens on ScaiKey directly. See scaikey.scailabs.ai/docs. ScaiVault accepts the resulting bearer tokens on every endpoint.
Related#
- Authentication (Getting Started)
- Multi-tenancy
- Identity Reference
- Enrollment — how a new host obtains its own credential