Skip to content

Implement Google/Firebase Authentication #8

@Devasy

Description

@Devasy

Implement Google/Firebase Authentication

Description

Add Google/Firebase authentication support to the Splitwiser app to provide users with an easy sign-in option using their Google accounts.

Requirements

Frontend (React Native/Expo)

  • Install and configure Firebase SDK
  • Set up Google authentication provider
  • Create Google sign-in button in LoginScreen
  • Implement useGoogleAuth hook for handling Google authentication flow
  • Handle authentication state management with Firebase Auth
  • Add proper error handling for Google authentication failures

Backend (FastAPI)

  • Install Firebase Admin SDK
  • Set up Firebase service account configuration
  • Create /auth/login/google endpoint to verify Google ID tokens
  • Implement Google user registration flow
  • Handle linking Google accounts with existing email accounts

Dependencies to Add

Frontend

"firebase": "^10.6.0",
"expo-auth-session": "~5.0.2"

Backend

firebase-admin>=6.0.0

Configuration

  • Set up Firebase project configuration
  • Configure Google OAuth client IDs for Android/iOS/Web
  • Set up Firebase service account for backend verification
  • Add environment variables for Firebase configuration

Security Considerations

  • Verify Google ID tokens on the backend
  • Implement proper token refresh mechanism
  • Handle account linking scenarios
  • Add rate limiting for authentication endpoints

UI/UX

  • Design Google sign-in button following Google's branding guidelines
  • Add loading states during authentication
  • Implement proper error messages for authentication failures
  • Add "OR" divider between email/password and Google authentication

Testing

  • Add unit tests for Google authentication flow
  • Test authentication on different platforms (Android/iOS/Web)
  • Test error scenarios (network failures, invalid tokens, etc.)
  • Test account linking scenarios

Implementation Notes

  • This feature was temporarily removed to focus on basic email/password authentication
  • The previous implementation included Firebase configuration and Google Auth integration
  • Consider using Firebase Authentication for user management and session handling
  • Ensure compliance with Google's OAuth policies and branding guidelines

Priority

Medium - This is a nice-to-have feature that will improve user experience but is not critical for the MVP.

Dependencies

  • #[issue_number] - Basic authentication system must be working
  • Firebase project setup and configuration

Acceptance Criteria

  • Users can sign in with their Google account
  • Google authentication is properly integrated with existing authentication system
  • Proper error handling and user feedback
  • Authentication state is maintained across app sessions
  • Backend properly verifies Google ID tokens
  • UI follows Material Design guidelines for Google sign-in

Metadata

Metadata

Assignees

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions