Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

251
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda