Skip to content

Auth (Desktop): send heartbeats on SecureTokenRequest - #2003

Merged
AustinBenoit merged 1 commit into
mainfrom
fix/auth-secure-token-heartbeat
Dec 3, 2026
Merged

AustinBenoit merged 1 commit into
mainfrom
fix/auth-secure-token-heartbeat

Conversation

@AustinBenoit

Copy link
Copy Markdown
Contributor

Description

Pass deliver_heartbeat = true in SecureTokenRequest so returning desktop users refreshing persisted Auth sessions via securetoken.googleapis.com/v1/token attach the stored heartbeat header (x-firebase-client) and X-Firebase-GMPID, matching the other desktop Auth RPCs and Firebase iOS Auth.

Previously, SecureTokenRequest was the only desktop Auth RPC passing deliver_heartbeat = false, so returning signed-in desktop sessions that only refreshed expired ID tokens never flushed daily heartbeats through Auth.

Changes

  • auth/src/desktop/rpcs/secure_token_request.cc: pass true for deliver_heartbeat to AuthRequest.
  • auth/tests/desktop/rpcs/auth_request_heartbeat_test.cc: update TestSecureTokenRequestHasHeartbeat to assert x-firebase-client and X-Firebase-GMPID are populated.

Testing

  • Built and ran desktop Auth unit tests locally (firebase_auth_request_heartbeat_test, firebase_auth_secure_token_test, firebase_auth_desktop_test, firebase_auth_user_test, firebase_auth_test).

Pass deliver_heartbeat = true in SecureTokenRequest so returning desktop
users refreshing persisted sessions via securetoken.googleapis.com/v1/token
attach the stored heartbeat header (x-firebase-client) and X-Firebase-GMPID,
matching the other Auth desktop requests and Firebase iOS Auth.

Update AuthRequestHeartbeatTest to verify SecureTokenRequest includes the
heartbeat and GMP App ID headers.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates SecureTokenRequest to enable heartbeat payloads by changing the third argument of the AuthRequest constructor to true. Additionally, the corresponding unit test in auth_request_heartbeat_test.cc has been updated to verify that the request headers now include both the heartbeat payload and the GMP App ID. There are no review comments, so I have no feedback to provide.

@AustinBenoit AustinBenoit added the skip-release-notes Skip release notes check label Dec 3, 2026
@AustinBenoit
AustinBenoit enabled auto-merge (squash) December 3, 2026 20:24
@AustinBenoit
AustinBenoit merged commit 8220359 into main Dec 3, 2026
44 of 56 checks passed
@github-actions github-actions Bot added the tests: in-progress This PR's integration tests are in progress. label Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

✅  Integration test succeeded!

Requested by @AustinBenoit on commit 8220359
Last updated: Thu Dec 3 14:32 PST 2026
View integration test log & download artifacts

@github-actions github-actions Bot added the tests: succeeded This PR's integration tests succeeded. label Dec 3, 2026
@firebase-workflow-trigger firebase-workflow-trigger Bot removed the tests: in-progress This PR's integration tests are in progress. label Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-release-notes Skip release notes check tests: succeeded This PR's integration tests succeeded.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants