Authentication Reference
All authentication-related endpoints. For conceptual background, see Authentication.
Base path: /api/v1/auth/
GET /api/v1/auth/config#
Returns OAuth 2.0 configuration for frontends to initiate the authorization code flow. No authentication required.
Response:
1 2 3 4 5 6 7 8 9 10 | |
POST /api/v1/auth/token#
Exchanges an OAuth authorization code for access and refresh tokens. Used after the user completes the ScaiKey auth flow and returns with a code parameter.
Request:
| Field | Type | Required |
|---|---|---|
code |
string | Yes |
code_verifier |
string | Yes (PKCE) |
redirect_uri |
string | Yes (must match what was sent to authorize endpoint) |
Response:
1 2 3 4 5 6 7 | |
POST /api/v1/auth/refresh#
Exchanges a refresh token for a new access token.
Request:
1 | |
Response: Same shape as /token. The refresh token is typically rotated — save the new refresh_token and discard the old one.
GET /api/v1/auth/me#
Returns the current authenticated user. Merges JWT claims with local database state (role assignments, tenant info).
Auth: JWT or API key.
Response:
1 2 3 4 5 6 7 8 9 10 11 12 | |
POST /api/v1/auth/logout#
Revokes the current token at ScaiKey (if supported by the provider) and clears any server-side session.
Auth: JWT.
Response: {"status": "ok"}
POST /api/v1/auth/validate#
Validates a JWT without the caller needing to fetch JWKS. Useful for services that want to delegate token verification to ScaiDNS.
Request:
1 | |
Response:
1 2 3 4 5 6 | |
On invalid tokens, returns {"valid": false, "reason": "..."}.
/api/v1/me (alternate)#
For convenience, ScaiDNS exposes a thin /me router in addition to /auth/me:
GET /api/v1/me/— user info (same as/auth/me)GET /api/v1/me/context— user + full tenant contextPOST /api/v1/me/permissions/check— check if the caller has a specific permission
POST /api/v1/me/permissions/check#
Request:
1 2 3 4 5 | |
Response:
1 | |
Or:
1 | |
Related#
- Authentication guide — OAuth flow walkthrough.
- Permissions and Access — how authorization resolves.
- API Keys — alternative auth method for machine clients.