Docs updates.

This commit is contained in:
2025-12-19 20:23:49 +00:00
parent 0bfb035f76
commit d25124d30b
2 changed files with 43 additions and 1 deletions
+10 -1
View File
@@ -1,6 +1,14 @@
# Paskia API
Use these tables when integrating Paskia authentication into your app.
## Integrating with your app frontend
Protect API routes with forward-auth (see [Caddy](Caddy.md)). Optionally protect your app assets and not just the API.
Catch response status 401/403 in fetch calls to protected endpoints and implement authentication flow in this case. The response is JSON and contains `auth.iframe` (a URL). [Render that URL in an iframe](AuthFlow.md) and retry the request after authentication.
While the app is in (active) use, call `/auth/api/validate` occasionally to keep the session alive (session lifetime is 24h), otherwise the user will have to login every day. Max-age limits are unaffected by this and can be used on endpoints needing to reauthenticate with passkey more frequently.
Use `/auth/api/user-info` to display user/session details, or link to `/auth/` if you prefer using the built-in profile UI and not having to anything more.
### Web Interface
@@ -59,5 +67,6 @@ On the auth host:
- Auth WebSockets remain at `/auth/ws/*` but take connections from other hosts to issue sessions for each of those.
On non-auth hosts:
- `/auth/` shows only minimal profile and allows logging out of the current site
- `/auth/api/*` is served normally.
- `/auth/api/user/*`, `/auth/api/admin/*`, and `/auth/ws/*` don't exist.