Skip to content

feat(auth): add browser OIDC authorization-code login - #163

Draft
djwhitt wants to merge 10 commits into
oidc-api-capabilitiesfrom
oidc-web-login
Draft

feat(auth): add browser OIDC authorization-code login#163
djwhitt wants to merge 10 commits into
oidc-api-capabilitiesfrom
oidc-web-login

Conversation

@djwhitt

@djwhitt djwhitt commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add browser Authorization Code login with explicit state, nonce, and S256 PKCE
  • exchange codes through bounded Req calls at validated provider endpoints
  • strictly verify ID tokens, hash claims, audience/authorized-party binding, timestamps, nonce, and JWKS rotation
  • store only bounded normalized identity in encrypted, Secure production sessions portable across web nodes
  • add CSRF-protected local logout while preserving static Basic auth

Tracker: T-234

Validation

  • ../bin/x mix ci
  • ../bin/test
  • ../bin/x mix dialyzer
  • controller/cookie/PKCE/token negative tests and repeated protocol review

Stack

Depends on #162. This is layer 6 of stack #151.

Stack managed with GitHub Stacks CLI.

Add fail-closed browser login and callback handling with explicit state, nonce, S256 PKCE, bounded Req token exchange, strict ID-token verification, and encrypted minimal sessions. Sessions are portable across web nodes, renewed at login, bounded by assertion expiry, and guarded by a temporary all-capabilities fence until route and event authorization lands.

Provide CSRF-protected local logout and preserve static Basic authentication.
@djwhitt djwhitt changed the title oidc web login feat(auth): add browser OIDC authorization-code login Aug 15, 2026
@djwhitt
djwhitt marked this pull request as draft August 16, 2026 00:09
Carry the hardened provider cache, separated token profiles, updated lower stack, and current origin/main into the published browser-login layer without rewriting existing commits.
T-234 carries the validated exp-plus-skew boundary into the web auth context so a freshly accepted ID token is not rejected immediately by policy.
T-234 stores a bounded set of short-lived browser authorization transactions, consumes only the matching state before exchange, and preserves unrelated tabs when a callback is stale or forged.
Propagate the provider key-set and refresh-worker lifecycle fixes through the published browser-login layer without rewriting existing commits.
T-234 removes the matching browser transaction when the provider returns an error callback, while preserving unrelated login attempts and the generic failure response.
Propagate the lower-stack callback, host, and scope validation into the browser-login layer without rewriting existing commits.
Store each state, nonce, and PKCE verifier in an independently named encrypted auth-path cookie so concurrent login and callback responses cannot overwrite or restore another transaction. Request configured browser scopes and expose a CSRF-protected OIDC logout control that clears identity and pending transactions.

Tests: ../bin/x mix ci
Tests: ../bin/test
Tests: ../bin/x mix dialyzer

Refs T-234 and PL-27.
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