Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

242
Views
Decoding a firebase ID token failed

this is getting really frustrating for me so I am asking for your help.

What I am doing is basically just want to authenticate a user with google authentication, so user can log in or sign up. Everything went well while I was doing localhost development, now I hosted my so called app and it does not work I am getting this:

FirebaseAuthError: Decoding Firebase ID token failed. Make sure you passed the entire string JWT which represents an ID token. See https://firebase.google.com/docs/auth/admin/verify-id-tokens for details on how to retrieve an ID token.

So what I did was this: I initialized firebaseConfig and everything on the front-end.

Now on the back end I am having problems, I downloaded my JSON token , and added it like that:

import * as firebaseAdmin from 'firebase-admin';
var serviceAccount = require("../serviceKey.json");
firebaseAdmin.initializeApp(
    {
        credential: firebaseAdmin.credential.cert(serviceAccount)
    });

export const db = firebaseAdmin.firestore();
export const auth = firebaseAdmin.auth();


codePrefix: 'auth'

serviceKey.json is where I am having the object things like project_id,private_key_id and so on.

What am I doing wrong? How come I cannot make this work in production? What else do I need to do.

I assume the frontend works well, no errors there just when about to make an authentication this happens.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Okay so I figured out what was the problem, I deployed both my front and my backend separately to Heroku, I initially wanted to host it on firebase but it is no longer free, so long story short I had to authorize my domain on the frontend in

firebase console -> authentication->sign-in method->Authorized domains.

After that it worked ,hope it helps someone.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!