Skip to content

[Auth] Epic: Implement Google OIDC authentication #19

Open

Description

@rd-code-23

Objective

Implement secure Google OIDC login for GoForLift using PostgreSQL-backed server-side sessions and an opaque session ID in an HttpOnly cookie. Application JWT authentication is explicitly outside the MVP.

Architecture decisions

  • Google OpenID Connect for registered-user identity
  • openid-client for OIDC discovery and Authorization Code Flow
  • express-session for session lifecycle and cookies
  • connect-pg-simple for PostgreSQL session persistence using the existing pg pool
  • csrf-sync for synchronizer-token CSRF protection
  • Drizzle owns the session-table migration; runtime table creation remains disabled
  • Google users are keyed by the stable sub claim, never email
  • Provider tokens are not retained after login unless a future feature requires them
  • No Passport and no GoForLift-issued JWT for the MVP

Architecture documentation: #2

Phase 1 — Foundation

Complete these in order:

Phase 2 — Backend authentication

Begin after the relevant Phase 1 dependencies are complete:

Phase 3 — Web integration

Begin after the corresponding backend contracts are stable:

Phase 4 — Hardening and delivery

Complete after the end-to-end flow works:

Cross-cutting security requirements

  • Enforce authentication and resource authorization on the server
  • Regenerate the session ID after successful login
  • Invalidate the server-side session during logout
  • Apply CSRF protection to every state-changing cookie-authenticated request
  • Use explicit cookie, proxy, CORS, and redirect policies
  • Never log or expose cookies, authorization codes, tokens, session contents, or secrets
  • Never trust client-provided ownership information

Epic completion criteria

  • Every linked issue is complete
  • Architecture, database, requirements, and implementation agree
  • Repository format, lint, typecheck, test, and build checks pass
  • Google login, auth hydration, protected access, CSRF rejection, and logout are manually verified
  • The authentication PR is reviewed and merge-ready

Out of scope

  • Password authentication
  • Additional identity providers
  • Account linking
  • Device/session management UI
  • Native mobile access tokens
  • Administrative session revocation
  • Application JWT authentication

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions