swarmctl login: find the sso provider from the gateway's published metadata
This commit is contained in:
parent
c1851f37cc
commit
cd040afa0e
1 changed files with 421 additions and 16 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue