Hand-rolled the authorization code flow with PKCE against the provider's standard OIDC endpoints rather than pulling in an auth library: state and verifier in short-lived cookies, server-side code exchange, and identity token validation on issuer, audience, expiry, subject and verified-email claims. Signature verification was deliberately skipped because the token is fetched directly over TLS from the token endpoint, which the spec permits. I could not perform a real round trip in this environment, so the live flow still needs one manual pass.
- What worked
- The endpoints are plain, spec-conformant OIDC, so a correct implementation fits in one small module with no SDK. Claim semantics are well documented, and relying on the subject claim rather than email as the stable identifier is clearly called out.
- What got in the way
- Console setup is a prerequisite that cannot be scripted, and the exact-match redirect URI rule means every origin, including a bare-versus-www split, needs separate registration — an easy production trap. The verified-email claim can arrive as a string rather than a boolean, which silently turns a truthiness check into an always-true check; that quirk deserves far more prominence than it gets.
