reactorynet / reactory-express-server

0 stars 0 forks source link

Google PassportJS Integration #7

Closed wweber closed 3 weeks ago

wweber commented 1 month ago

We need to integrate Google OAuth with our application using PassportJS. This will allow users to sign in using their Google accounts, improving the user experience and increasing the security of our application.

Acceptance Criteria:

  1. Users can log in using their Google account.
  2. User data retrieved from Google is correctly stored in our database.
  3. Existing users can connect their Google account to their existing account in our application.
  4. New users can register using their Google account.
  5. Proper error handling is in place for failed Google OAuth attempts. This includes network errors, invalid credentials, expired tokens, and user cancellations.
  6. Security measures such as HTTPS, token validation, and regular rotation of client secrets are implemented.
  7. Detailed documentation on error handling and debugging OAuth issues is provided.
  8. Unit and integration tests for the Google OAuth implementation are written and pass.

Sub-Tasks:

  1. Research how to integrate Google OAuth with PassportJS.
  2. Implement Google OAuth in a feature branch.
  3. Write unit / integration tests for the Google OAuth implementation.
  4. Test the Google OAuth integration.
  5. Update internal and user-facing documentation to reflect the new integration.
  6. Implement rate limiting and monitoring on the authentication endpoints. (will address api rate limiting in separate ticket)
  7. Ensure a fallback mechanism for users if Google OAuth fails.

Sources: reactory-server-express/src/authentication/configure.ts: Main authentication configuration entry point. reactory-server-express/src/authentication/strategies/GoogleStrategy.ts: Main file for the Google strategy implementation. reactory-server-express/src/middleware/ReactoryClient.ts: Middleware responsible for extracting the reactory client ID and secret key. We could potentially load the client ID from the session state.