Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

195
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!