fix(32.2): WR-02 refuse a ConsentPath that is not a same-origin path
Add wristband.CheckConsentPath (additive, for hosts to call at boot) and make Authorize answer 500 before storing a pending request while the configured path fails it, so the handoff can never leave the issuer's origin.
This commit is contained in:
@@ -106,7 +106,7 @@ The metadata document advertises these paths under the issuer, so mount them at
|
||||
|
||||
## Consent
|
||||
|
||||
The authorization endpoint sends the browser to `<issuer>/connect?request=<id>`, or to `wristband.Options.ConsentPath` on the issuer when the application sets one (for a consent page under the admin prefix, for example); an empty path keeps the PHP bytes exactly. A request that names no data scope gets `read`, or `wristband.Options.DefaultScopes` filtered to the accepted scopes when that list leaves anything; a server that accepts neither refuses it with `invalid_scope`. With `wristband.Options.DefaultScopes` set, a request that names only `offline_access` gets those scopes too and keeps offline access. That page belongs to the application: it signs the user in, shows what the client asks for and posts the decision to the application's own consent handler, which calls:
|
||||
The authorization endpoint sends the browser to `<issuer>/connect?request=<id>`, or to `wristband.Options.ConsentPath` on the issuer when the application sets one (for a consent page under the admin prefix, for example); an empty path keeps the PHP bytes exactly. The path must be a plain same-origin absolute path (`wristband.CheckConsentPath`, which the application can call at boot); while it is not, authorize answers 500 instead of redirecting. A request that names no data scope gets `read`, or `wristband.Options.DefaultScopes` filtered to the accepted scopes when that list leaves anything; a server that accepts neither refuses it with `invalid_scope`. With `wristband.Options.DefaultScopes` set, a request that names only `offline_access` gets those scopes too and keeps offline access. That page belongs to the application: it signs the user in, shows what the client asks for and posts the decision to the application's own consent handler, which calls:
|
||||
|
||||
- `wristband.Server.PendingRequest` to read what to show, as a `wristband.PendingRequestView`, including `wristband.PendingRequestView.OfflineAccess` (the pending row's flag; `offline_access` is not a scope on the view and `wristband.Server.IssueCode` is unchanged);
|
||||
- `wristband.Server.IssueCode` to grant, which returns the redirect URL carrying the code, `iss` and `state`;
|
||||
|
||||
Reference in New Issue
Block a user