Watch
0
0
Fork
You've already forked hyperhive
0

swarmctl login: find the sso provider from the gateway's published metadata

This commit is contained in:
atlas 2026-11-23 20:55:42 +01:00 • committed by mara
commit cd040afa0e

View file

@ -148,6 +148,21 @@ it nothing to verify. The queue's responder introspects instead — a
different question asked of the same token, and the reason both
`/api/oidc/introspection` and `/jwks.json` have to stay reachable.
## How `swarmctl login` finds authelia
The client knows only the swarm's domain, not the auth domain. The swarm
publishes the link as OAuth protected resource metadata (RFC 9728). The
gateway's `/api/` answers a request with no login with a 401 whose
`WWW-Authenticate` challenge carries `resource_metadata`. That parameter names
`https://<swarm>/.well-known/oauth-protected-resource/api/`, a document
served with no `auth_request`. It lists the API as `resource` and authelia as
the `authorization_servers`.
The client reads the document from the swarm's own origin only. It refuses a
`resource` other than the audience it asks for, and a server that isn't
https. `swarm-ui.nix` declares the metadata beside the challenge that names
it.
## Machine callers must fail closed
⚠️ **An error page that answers `200` is a security bug, not a cosmetic