Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Unexpected Token Exchange Spikes in Secure Token API – Exceeding 20k Requests per Minute

maad
New Member

Hello Community,

I'm experiencing an unusual spike in Token Exchange per Minute for the Secure Token API in my Google Cloud project. Even though the number of active users is significantly lower than 20,000, the token exchange rate has exceeded this number at peak times.

Issue Details:

  • Service: Secure Token API (securetoken.googleapis.com/secure_token_requests)
  • Unexpected Behavior: Token Exchange per Minute exceeding 20,000 despite fewer active users.
  • Quota Limits:
    • Token Exchange Per Minute: 18,000
    • Token Exchange Requests Per Minute: 6,000
    • Observed Peak Usage: Reaching 100% utilization intermittently.
  • Error Trigger: This issue appears to happen when the app tries to store image data to Firebase Storage.

Questions for the Community:

  • What could cause the Token Exchange per Minute to exceed the number of active users?
  • Are there common misconfigurations in Firebase Auth or Firestore that could lead to excessive token requests?
  • Could this be related to how Firebase handles authentication refresh tokens when accessing Storage?
  • Any best practices to optimize token exchange usage and avoid unnecessary authentication requests?

I’d appreciate any insights or troubleshooting suggestions! I’ve attached relevant screenshots for context.

Thanks in advance!
Screenshot 2025-02-11 at 9.52.39 AM.png

0 1 235