Skip to content

feat: ory authn - #2579

Open
vinckr wants to merge 7 commits into
boxyhq:mainfrom
vinckr:migrate-ory
Open

vinckr wants to merge 7 commits into
boxyhq:mainfrom
vinckr:migrate-ory

Conversation

@vinckr

@vinckr vinckr commented Sep 8, 2026

Copy link
Copy Markdown
  • feat: migrate to Ory
  • fix: more tests
  • chore: remove stale code

@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

@vinckr is attempting to deploy a commit to the BoxyHQ Team on Vercel.

A member of the Team first needs to authorize it.

@vinckr

vinckr commented Sep 30, 2026

Copy link
Copy Markdown
Author

Pushed the review fixes in 3dd40dd.

  • SSO authorization: team membership now requires a short-lived server-side grant from a verified Jackson exchange, matched to the Ory sso credential and recent authentication. Grants are consumed atomically; the tenant cookie only selects the IdP. Subjects are scoped by tenant/product. Code redemption also rejects replay, including equivalent hex encodings, and cleans up failed/expired redemption records.
  • Account linking: legacy/SCIM accounts require a matching verified Ory email. Existing identity bindings cannot be overwritten. Conditional updates protect against concurrent linking conflicts.
  • OIDC compatibility: tenant/product routing preserves client_id=dummy, so the ID-token audience matches Ory's configuration. Basic client authentication remains supported.
  • Membership controls: the client session now uses the application's local user ID. Server-side checks reject self-removal/self-demotion through member-management endpoints; the existing Leave team flow remains available.
  • Invitations: legacy invitation links become Ory return_to destinations, preserved through SSO and email verification.
  • IdP-initiated login: the unsolicited code is redeemed and its tenant/product validated before starting a fresh Ory-controlled SSO round trip.
  • Profile settings: name/email updates use Ory Elements settings and synchronize into Prisma; email changes require verification. Avatar updates remain local. Superseded Prisma-only profile forms were removed.

Validation:

  • npm test -- --runInBand: 80 tests passed, 17 suites. Regression cases cover forged tenant cookies, unverified/conflicting email links, stale/foreign/expired grants, concurrent replay, self-membership changes, invitation destinations, IdP-code validation, profile synchronization and avatar updates.
  • node_modules/.bin/tsc --noEmit --incremental false, npm run check-format, and npm run build-ci: passed.
  • Source lint passed with npm run check-lint -- --ignore-pattern 'playwright-report/**'; the unqualified command also scans previously generated Playwright report JavaScript.
  • Executed the installed Jackson controller with in-memory stores and fresh RSA keys: verified the signed token's issuer/audience/nonce, scoped subject, userinfo tenant, and unsolicited IdP-code exchange.
  • A fresh independent review identified return-destination and failed-redemption cleanup edge cases; both were corrected.

Remaining validation/deployment notes:

  • Full browser SAML/IdP/SCIM integration was not run. The contract check uses a synthetic already-verified upstream profile; unit tests mock Ory/Prisma boundaries.
  • Repository-wide locale and unused-code checks remain failing. The locale script crashes on Dirent.path under the installed Node version; a compatibility shim also exposed missing/unused translations. The unused-code check reports migration leftovers and unlisted dependencies. No checker was weakened.
  • Deployments that already created unscoped sso credentials from an earlier revision need a controlled subject migration or verified relinking. Runtime SSO membership checks require access to Ory's admin identity API. Both requirements are documented in the README.

@vinckr
vinckr marked this pull request as ready for review September 30, 2026 16:31

This branch has not been deployed

No deployments
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