Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

244
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda