Skip to content

feat: Firebase Auth integration with Google SSO login flow#1

Merged
santthosh merged 5 commits intomainfrom
feature/firebase-auth-google-sso
Feb 14, 2026
Merged

feat: Firebase Auth integration with Google SSO login flow#1
santthosh merged 5 commits intomainfrom
feature/firebase-auth-google-sso

Conversation

@santthosh
Copy link
Owner

Summary

  • API: Complete Firebase Auth middleware (replace 501 stub with real token verification for both production and emulator), add auth routes for Google OAuth start/callback/poll, dev emulator sign-in, and authenticated user profile
  • Desktop: Add server-mediated Google SSO flow (opens system browser, polls API for result), dev emulator sign-in with email, token persistence in localStorage with automatic refresh, and gate the app behind a login screen
  • UI: Login screen with Google SSO button (production) or email input (emulator mode), user avatar menu with sign-out dropdown in the header

Architecture

Uses a server-mediated OAuth flow since Tauri v2's webview doesn't support signInWithPopup():

  1. Desktop calls POST /api/auth/google/start to get a session ID and Google OAuth URL
  2. Desktop opens the URL in the system browser via tauri-plugin-shell
  3. User completes Google sign-in, browser redirects to GET /api/auth/google/callback
  4. API exchanges the auth code for Firebase tokens, creates/updates user in Firestore
  5. Desktop polls GET /api/auth/google/poll until complete, stores tokens locally

Test plan

  • make lint and make typecheck pass (verified)
  • pnpm --filter desktop test passes (verified)
  • make dev — app shows login screen on launch
  • Dev sign-in with email works against Firebase Emulator
  • After sign-in, main app renders with UserMenu in header
  • Sign out returns to login screen
  • Session persists across app restart (localStorage)
  • Health check / ConnectionStatus still works (unauthenticated)

🤖 Generated with Claude Code

santthosh and others added 5 commits February 7, 2026 23:28
Implement server-mediated Google OAuth flow for Tauri desktop app:
- API: complete auth middleware with Firebase token verification
  (production via Admin SDK, emulator via REST), add auth routes
  (Google OAuth start/callback/poll, dev signin, user profile)
- Desktop: add auth module with token management, localStorage
  persistence, and automatic refresh. Gate app behind login screen
  with Google SSO button (production) or email input (emulator).
  Add UserMenu component with avatar and sign-out dropdown.
- Spec: add specs/r1a/02.firebase-auth-google-sso.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove unused Postgres/Redis references from requirements.txt,
  service.yaml, deploy.sh, and secrets.example
- Add Secret Manager resources for google-client-id and
  google-client-secret (per-environment) with IAM bindings
- Inject OAuth secrets + API_BASE_URL into Cloud Run via Terraform
- Add api_base_url variable to each environment config
- Enable secretmanager.googleapis.com API in Terraform

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cloud Run fails to deploy when referencing a secret that has no
versions. Add initial placeholder versions with ignore_changes so
Terraform won't revert after real values are set via gcloud CLI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The desktop app checks this env var to show the dev sign-in form
instead of triggering Google OAuth. Without it, local dev hits
the Google OAuth start endpoint which fails because no client ID
is configured.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the server-mediated start/callback/poll OAuth flow with a
loopback redirect approach: the Tauri app binds a one-shot local HTTP
listener, Google redirects the auth code to it, and the desktop
exchanges the code for Firebase tokens via a single API endpoint.
This eliminates server-side session state, polling, and the emulator
sign-in path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@santthosh santthosh merged commit 7374bf6 into main Feb 14, 2026
7 checks passed
@santthosh santthosh deleted the feature/firebase-auth-google-sso branch February 14, 2026 04:48
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