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

248
Visualizações
How to get Google API refresh token from Firebase Auth?

I'm building a chrome extension in React using Firebase Auth for login. The google api access token expires after 1 hour and I can't use the gapi client library in a chrome extension.

As such I'm manually refreshing the token by calling google's api. However, how do I get access to the refresh token?

According to this post, a refresh token is returned only after the first sign in, so I used the instructions to remove access and re-prompt permissions. Console.logging credential returned the following but no refresh token:

accessToken: "ya29..."
idToken: "eyJhbGciOiJSUz..."
pendingToken: null
providerId: "google.com"
signInMethod: "google.com"

Sign In code:

const login = async () => {
    signInWithPopup(auth, provider)
      .then((result) => {
        // This gives you a Google Access Token. You can use it to access the Google API.
        const credential = GoogleAuthProvider.credentialFromResult(result);
        const token = credential.accessToken;
}

Any idea how to get the google api refresh token?

about 4 years ago · Juan Pablo Isaza
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