Skip to content

Added Firebase Admin SDK#73

Merged
eshaan-mehta merged 17 commits intostagingfrom
admin-sdk-setup
Jan 29, 2026
Merged

Added Firebase Admin SDK#73
eshaan-mehta merged 17 commits intostagingfrom
admin-sdk-setup

Conversation

@SNubby19
Copy link
Contributor

integrated the admin sdk, used it to add a create token method, sorry if its in the wrong spot

eshaan-mehta and others added 2 commits January 28, 2026 00:18
…om the frontend, we just need to pass in the uid of the person trying to sign in
@github-actions github-actions bot changed the base branch from main to staging January 29, 2026 05:35
@SNubby19 SNubby19 requested a review from Copilot January 29, 2026 05:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request integrates the Firebase Admin SDK into the backend to enable custom Firebase token generation. The PR adds firebase-admin>=7.1.0 as a dependency and implements a get_firebase_token method in the AuthConnector class that creates custom Firebase authentication tokens for given user IDs.

Changes:

  • Added firebase-admin (v7.1.0) dependency along with its transitive dependencies (cryptography, google-api-core, google-cloud-firestore, google-cloud-storage, and related packages)
  • Implemented a get_firebase_token method in AuthConnector class that initializes the Firebase Admin SDK and creates custom tokens

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 8 comments.

File Description
backend/pyproject.toml Added firebase-admin>=7.1.0 dependency declaration
backend/uv.lock Added firebase-admin and all transitive dependencies with locked versions
backend/auth/auth_connector.py Added Firebase Admin SDK imports and implemented get_firebase_token method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@adithayyil
Copy link
Member

create_custom_token() creates a backend token. we don't need to do that. recall the device flow:

  1. User visits website
  2. User clicks "Login with Google" (or email/password)
  3. Firebase Auth handles the login, returns ID token to website
  4. Website already has a valid Firebase token
  5. Website sends that token to our backend
  6. Backend needs to check: "Is this token real? Was it actually signed by Firebase? Is it expired?"

we're not creating tokens. firebase auth already will do that on the website. we're just verifying them.

instead use verify_id_token(). i will make this myself and add tests.

Allows website to authorize device after user login with Firebase token
Loads credentials from FIREBASE_ADMIN_KEY secret for token verification
@adithayyil adithayyil mentioned this pull request Jan 29, 2026
@adithayyil
Copy link
Member

added the missing /auth/device/authorize endpoint and integrated fb admin sdk initialization on server startup. Fixed all auth endpoints to properly accept JSON body parameters using Body() annotations. Wrote 12 comprehensive unit tests covering device code generation, polling, authorization, and full integration flow. all passing.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@eshaan-mehta eshaan-mehta merged commit f6d172d into staging Jan 29, 2026
6 checks passed
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.

3 participants