Overview

Firebase Authentication issues ID tokens as JWTs. Your backend must verify them using Firebase Admin SDK or Google public keys.

Admin SDK (Recommended)

const decoded = await admin.auth().verifyIdToken(idToken);
// decoded.uid is the user ID

Manual Verification

Fetch Google JWKS, verify RS256 signature, validate aud (project ID), iss (securetoken.google.com), and exp.

Debug

Use JWT Decoder during development. See Firebase JWT Guide.

Understanding Firebase JWT Verification — ID Token Guide in Production

Developers search for Firebase JWT Verification — ID Token Guide when building API authentication with JSON Web Tokens. JWTs are used by OAuth 2.0, OpenID Connect, Auth0, Firebase, AWS Cognito, and Keycloak. Always validate exp, iss, and aud server-side — decoding alone proves nothing about authenticity.

JWT Structure Recap

Every JWT has three dot-separated segments: header (algorithm), payload (claims), signature (proof). Use JWT Decoder to inspect and JWT Validator to verify before trusting any claim value in production code.

Common Pitfalls

  • Algorithm confusion (none attack) — whitelist allowed algorithms
  • Secrets in the payload — payload is only Base64-encoded, not encrypted
  • Ignoring clock skew on exp and nbf
  • Weak HMAC secrets — use 256-bit random keys
  • Skipping signature verification — always call verify(), not decode()
  • Storing tokens in localStorage — XSS can steal them

Further Reading

Browse related resources: JWT Decoder, JWT Validator, JWT Basics, JWT Authentication, JWT Errors, Algorithms, Glossary, and Learning Path.

Try It Now

FAQ

Is Firebase ID token a JWT?

Yes. Firebase ID tokens are JWTs signed by Google. Verify on your server, never trust client-side decode alone.

What is the Firebase audience?

Your Firebase project ID.