UniTutor LTI 1.3 B2B: Option B + JWKS fail-closed
Scope
- LTI 1.3 Resource Link launch only (OIDC login →
id_token POST → canvas). LTI 1.1 / AGS / NRPS / Deep Linking excluded.
- Eric-approved Option B: D1 learner key
(iss, client_id, deployment_id, sub).
- Public API:
GET /lti/oidc/login, POST /lti/launch → FE ?courseId=<iLearnerId=. Existing POST /api/tutor/turn unchanged.
Security SoR
- Workers default is
verifyIdTokenWithJwks (jose + deployment jwks_url, RS256, exp/iat ±60s). Unsigned / alg=none rejected.
decodeIdTokenPayloadUnsafe is test-only. Prior tip without JWKS default → aa: security fail.
- FE:
lib/ltiLaunch.ts persists ltiLearnerId, strips URL params. Query ltiLearnerId is not a server session.
- Residual NF: allowlist
target_link_uri / redirect_uri; pilot LMS seed for happy-path smoke.
Deploy notes
- Real D1 required — placeholder UUID fails CF 10181. Create
unitutor D1 → bind in backend/wrangler.jsonc; migrations apply before Worker deploy.
- CD = Cloudflare single env (
deploy.yml), not k8s tenant_cd.
- Evidence tip
138eab1 (PR #29): Deploy 37168058116; live alg=none → 401 invalid_token (temp D1 seed then deleted).