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

197
Vistas
Google One tap identify a returning user and get id and email

I am implementing Google One tap and I am not understanding how to get the id of a user who has already authorize my application refresh or close the windows and reopen it again. My console is empty, but I can see that Google authentifies him. Here is my Google One tap code :

window.onload = function () {
    google.accounts.id.initialize({
        client_id: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com',
        auto_select: true,
        callback: data => handleCredentialResponse(data),
        state_cookie_domain: 'https://www.healxxxxxxxx.cm',
    });
    google.accounts.id.prompt((notification) => {
        if (notification.isNotDisplayed() || notification.isSkippedMoment()) {
            // try next provider if OneTap is not displayed or skipped
            
        }
    });
}
function handleCredentialResponse(response) {
    //console.log(response)
    user = parseJwt(response.credential);
    console.log("ID: " + user.sub);
    console.log('Full Name: ' + user.name);
    console.log("Email: " + user.email);
    console.log(JSON.stringify(parseJwt(response.credential)));
}

The code is supposed to ask authentication onload of the page. As soon as the user authorizes the app to get informations, I can see them via the function handleCredentialResponse. But when reloading the page and authorization already given, how I get the data of the user ?

If I se session, closing the browser will throw all informations. If I use cookies, I will be unable to use it on another browser. So how to read the data of the connected user who has already authorize my app ?

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