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

137
Visualizações
Can we reuse the access tokens retrieved from the firebase and can we get the user data only from those tokens?

So, I have an electron app and electron apps do not support the firebase/google auth by default. So my question is that I have 1 web app in which I'm using firebase auth. By using firebase auth, I'm using google sign in with it. Now the problem is that I have an electron app in which I want my user to login but since we can't use firebase auth inside electron app, I want that my user should login on the web app, and copy the generated access token from there in to the electron app. So, will it work? I'm getting the token like this:

        const credential =
        GoogleAuthProvider.credentialFromResult(result);
    const token = credential.accessToken;

If this access token can be used in any application then how do I get the user's e-mail ID, name etc via any application? Any example/guidance will be really appreciated. My code snippet is below:

signIn = () => {
    signInWithPopup(this.auth, this.provider)
        .then((result) => {
            // This gives you a Google Access Token. You can use it to access the Google API. 

//How do I access the google API only via access token? const credential = GoogleAuthProvider.credentialFromResult(result); const token = credential.accessToken; // The signed-in user info. const user = result.user; // ... console.log(token); console.log(user); alert( Dear ${user.displayName}, you are signed in successfully, ); }) .catch((error) => { // Handle Errors here. const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. const email = error.email; // The AuthCredential type that was used. const credential = GoogleAuthProvider.credentialFromError(error); // ... alert(Error while signing in: ${error}); }); };

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