Authorization header. This page explains how to obtain a token, how to use it, and how long-lived API keys work.
Pass the token
Include your token on every request:Get a token
InfraAudit uses Supabase Auth. Your access token is a signed JWT issued by your Supabase project. There are three ways to obtain one.Option 1: Sign in via the Supabase client
Use the Supabase JavaScript SDK if you’re building a browser or Node.js integration:
Option 2: Sign in via the InfraAudit API
POST your credentials to Response:
/api/login to receive a token directly:Use the token in requests
API keys
For non-interactive use cases such as CI/CD pipelines and automated scripts, create a long-lived API key instead of using a session token. Create an API key in the web UI: navigate to Settings → API Keys and click New key. Create an API key via the API:Authorization: Bearer header as session tokens.
Token format
Tokens are Supabase JWTs signed with either:- ES256 — ECDSA with a key pair managed by Supabase, verified via JWKS at
{SUPABASE_URL}/auth/v1/.well-known/jwks.json - HS256 — HMAC using
SUPABASE_JWT_SECRET
SSE / EventSource requests
For server-sent events endpoints, pass the token as a query parameter instead of a header:401 vs 403
| Status | Meaning |
|---|---|
401 Unauthorized | No token provided, token expired, or token is invalid |
403 Forbidden | Token is valid but the user lacks permission for this resource |