Auth API
5 endpoints. All under /v1/auth/. See
Authenticate with ScaiKey
for the overview.
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | /v1/auth/config |
None | Discover the OIDC config (issuer, JWKS URI, supported scopes). |
| POST | /v1/auth/login |
None | Exchange an OIDC code for tokens. |
| POST | /v1/auth/token |
None | Direct password grant (if enabled). |
| POST | /v1/auth/refresh |
None (refresh token in body) | Rotate access token. |
| POST | /v1/auth/register |
Bearer | Create / refresh the local participant for the bearer's principal. |
GET /v1/auth/config#
Returns the tenant's OIDC config for the client to bootstrap.
bash
1 | |
jsonc
{
"data": {
"issuer": "https://scaikey.example.com",
"authorization_endpoint": "https://scaikey.example.com/auth",
"token_endpoint": "https://scaikey.example.com/token",
"scopes_supported": ["openid", "profile", "email"],
"redirect_uri": "https://scaiwave.example.com/v1/auth/login"
}
}
POST /v1/auth/login#
Server-side OIDC code exchange. Body: code (query param or form
field).
bash
1 2 3 | |
json
1 2 3 4 5 6 7 8 | |
Errors:
SW_AUTH_OIDC_FAILED— code invalid / expired.SW_AUTH_REDIRECT_MISMATCH—redirect_uridoesn't match config.
POST /v1/auth/token#
Direct password grant. Disabled by default; enable per-tenant with
features.auth.password_grant_enabled = true.
bash
1 2 3 | |
POST /v1/auth/refresh#
bash
1 2 3 | |
Returns the same shape as /login. Rotates the refresh token if
your config has rotation enabled.
POST /v1/auth/register#
Idempotent: creates a Participant row for the bearer's principal
if one doesn't exist. Always safe to call on first sign-in.
bash
1 2 | |
json
1 2 3 4 5 6 7 8 9 | |