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

254
Vistas
How to add Firebase JWT to an Angular HTTP Request?

I have my own HTTP Service which provides GET, POST, PUT and DELETE methods and enables me to send the JWT from my Firebase user in the HTTP request header.

Now I'm able to get my user object from a redux store, and I can retrieve the JWT via the getIdToken() method on this user object. Unfortunately this method provides me with a Promise<string>.

Is there any way, I can build my Http-Options Object with this JWT-Header, before actually sending the request via Angular's HttpClient?

My Code:

async delete<T = any>(appendix: string): Observable<T> {
  const options: any = await this.httpOptions();
  return this.http.delete<T>(this.url + appendix, options);
}
    
private async httpOptions(): Promise<{ headers: { uid: string } }> {
  const user: User = this.authQuery.getValue();
  const token: string = await user.getIdToken().catch();
  return {
    headers: {uid: token},
  };
}
about 4 years ago · Juan Pablo Isaza
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