Skip to content

fix(004): point the sign-in link at the login initiator, not the proxy path#7

Merged
bartekus merged 1 commit into
mainfrom
004-fix-signin-url
Jul 21, 2026
Merged

fix(004): point the sign-in link at the login initiator, not the proxy path#7
bartekus merged 1 commit into
mainfrom
004-fix-signin-url

Conversation

@bartekus

Copy link
Copy Markdown
Contributor

The bug

Clicking Sign in on https://statecraft.ing sends the user to
https://app.statecraft.ing/auth/rauthy, which returns a
BadRequest / "cross-origin request forbidden for this resource".

/auth/rauthy is the control plane's rauthy proxy passthrough, not a login
route. A top-level cross-site navigation to it is refused by rauthy's own CSRF
guard (csrf_protection.rs). Spec 004 §3.2 called it "the OIDC kickoff path the
app used before the apex cutover", which is not true of the live control plane.

The fix

Point at https://app.statecraft.ing/api/v1/auth/login, the control plane's
driver-agnostic login initiator. It 302s to the active auth driver's OIDC
kickoff (rauthy today), so it also survives a driver change without another edit
here.

Verified live with browser-style headers (Sec-Fetch-Site: cross-site,
Sec-Fetch-Mode: navigate):

URL Result
/auth/rauthy (old) 400 cross-origin refusal
/api/v1/auth/login (new) 302 to /api/v1/auth/rauthy/login then /oidc/authorize?...scope=...groups...

Updates the component + comment and all four references in spec 004 (summary,
the §3.2 rationale with the correction recorded, and two acceptance/summary
lines).

Also in this PR: a pre-existing derived refresh

.derived was already stale on main, independent of this change: PR #6
merged with its govern check red. The by-package shard was still named
stagecraft-ing while package.json is statecrafting, and the 001-003
registry shards had drifted. Regenerating under the CI-pinned spec-spine
v0.10.0 (verified: index check fresh, lint --fail-on-warn clean, couple
no drift) brings the whole tree current, which is why shards for specs I did not
edit appear in the diff. This is what makes the governance gate green again.

Flagging it explicitly rather than folding it in silently: if you would rather
land the derived refresh separately, say so and I will split it.

…y path

The sign-in link and spec 004 §3.2 pointed at
https://app.statecraft.ing/auth/rauthy, described as the OIDC kickoff path.
On the live control plane that path is the rauthy proxy passthrough, not a
login route, and a top-level navigation to it is refused by rauthy's own CSRF
guard with a BadRequest / "cross-origin request forbidden for this resource".

The correct target is /api/v1/auth/login, the control plane's driver-agnostic
login initiator: it 302s to the active auth driver's OIDC kickoff (rauthy
today), so it also survives a driver change without an edit here. Verified
live: the old path returns the CSRF refusal, the new one 302s through to
/oidc/authorize with the PKCE + groups-scope authorize request.

Updates the component, its comment, and all four spec references (summary,
§3.2 rationale with the correction noted, and two acceptance/summary lines).

Also brings the committed .derived current. It was already stale on main
independent of this change (PR #6 merged with the govern check red): the
by-package shard was still named stagecraft-ing while package.json is
statecrafting, and the 001-003 registry shards had drifted. Regenerating under
the CI-pinned spec-spine v0.10.0 makes index check fresh again.
@bartekus
bartekus merged commit 4ca5837 into main Jul 21, 2026
1 check passed
@bartekus
bartekus deleted the 004-fix-signin-url branch July 21, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant