Skip to content

Implement Google SSO (OAuth2) – Backend #82

Closed
OpenCodeChicago/hacktoberfest-2025-backend
#39

Description

@Alexandrbig1

Priority: High
Difficulty: Advanced
Type: Backend Feature


Description:
Set up Google Single Sign-On (SSO) in the CoreX backend. The goal is to allow users to register/login with their Google account.


Requirements:

  • Install and configure Google OAuth 2.0:
    • Either with passport-google-oauth20 or google-auth-library.
  • Create endpoints:
    • GET /auth/google – redirect to Google login.
    • GET /auth/google/callback – handle Google’s response.
  • Flow:
    • Verify Google profile (id, email, name).
    • If user exists → return JWT.
    • If new user → create in MongoDB (authProvider: 'google'), then return JWT.
  • Securely store required environment variables:
    • GOOGLE_CLIENT_ID
    • GOOGLE_CLIENT_SECRET
    • GOOGLE_CALLBACK_URL
  • Document usage in README.

Acceptance Criteria:

  • User can authenticate with Google and receive a JWT.
  • New Google users are automatically saved in DB.
  • Errors (invalid token, failure to fetch user) are handled.
  • API is documented for frontend use.

Activity

  1. added
    authAuthentication & authorization
    google-ssoGoogle Single Sign‑On / OAuth
    advancedComplex/advanced tasks or features
    on Oct 5, 2025
  2. its-Pratik-15 commented on Oct 5, 2025

    @its-Pratik-15

    i want to contribute assign me this task

  3. Alexandrbig1 commented on Oct 5, 2025

    @Alexandrbig1
    ContributorAuthor

    @its-Pratik-15, are you sure you'll be able to implement this task? Have you experience with this task?

  4. its-Pratik-15 commented on Oct 5, 2025

    @its-Pratik-15

    I recently learned about OAuth in college, and I’d love to try implementing it!

  5. Gautam-Bharadwaj commented on Oct 6, 2025

    @Gautam-Bharadwaj

    @Alexandrbig1 Sir, I would like to request this project. I have the experience and am confident I can complete it successfully.

  6. dikamjit-borah commented on Oct 6, 2025

    @dikamjit-borah

    Hi @Alexandrbig1 I would like to work on this feature. I have experience building authentication systems in Node.js/Express backends.

  7. 2 remaining items

  8. Alexandrbig1 commented on Oct 6, 2025

    @Alexandrbig1
    ContributorAuthor

    @JHAJI01, thanks for your interest. I've assigned this task to another contributor. Please, feel free to find a task that matches your stack and let me know in the comments section of this task.

  9. Alexandrbig1 commented on Oct 6, 2025

    @Alexandrbig1
    ContributorAuthor

    @its-Pratik-15, this task was assigned to another contributor. Please feel free to find an open task and leave a comment, and I'll assign you there.

  10. dikamjit-borah commented on Oct 6, 2025

    @dikamjit-borah

    @Alexandrbig1 Thanks, I will get started on this.

  11. Ankit-Kum-ar commented on Oct 9, 2025

    @Ankit-Kum-ar

    Hi @dikamjit-borah, I wanted to ask how far you've reached with the task because I need to implement it on the frontend as well, so I need the backend to be ready. I've already created the basic code structure.

    CC: @Alexandrbig1

  12. Alexandrbig1 commented on Oct 9, 2025

    @Alexandrbig1
    ContributorAuthor

    Hi @dikamjit-borah, any updates?

  13. dikamjit-borah commented on Oct 9, 2025

    @dikamjit-borah

    Hi @Alexandrbig1, Its almost done, I will raise a PR by tomorrow.

  14. Alexandrbig1 commented on Oct 11, 2025

    @Alexandrbig1
    ContributorAuthor

    @dikamjit-borah, was completed in a PR on the backend repository. Thank you to the contributor for your work!

  15. dikamjit-borah commented on Oct 12, 2025

    @dikamjit-borah
  16. Alexandrbig1 commented on Oct 12, 2025

    @Alexandrbig1
    ContributorAuthor

    @dikamjit-borah, please leave a comment for the bot in your approved PR.

  17. Alexandrbig1 commented on Oct 15, 2025

    @Alexandrbig1
    ContributorAuthor

    Hey @dikamjit-borah ,

    🎉 Congratulations — your pull request has been merged!
    Thank you for your contribution to the CoreX Project as part of Open Code Chicago during Hacktoberfest 2025

    You’ve officially earned the Open Code Chicago × CoreX Contributor 2025 badge on Holopin 🏅
    👉 Claim your badge here: Claim Badge

    Once claimed, you can proudly display it on your GitHub profile, Holopin board, or share it on LinkedIn to celebrate your achievement!

    Keep contributing, learning, and building with us 🚀
    — Open Code Chicago Team

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

Metadata

Metadata

Labels

advancedComplex/advanced tasks or featuresauthAuthentication & authorizationbackendIssues related to backendgoogle-ssoGoogle Single Sign‑On / OAuthhacktoberfestSpecial issue for Hacktoberfesthacktoberfest-2025Special issue for Hacktoberfest 2025priority: highNeeds attention ASAP

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions