Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable this credentials-picker from Google in my site?

I'd like to integrate an auto-login pop-up as the one displayed in https://www.lequipe.fr

It detects your session in the browser and asks you if you want to join with your Google Account.

How can I implement this in my website? ( I already have Google Sign in ) - is using the GAPI API?

like image 205
VictorNavarro Avatar asked Jun 08 '20 15:06

VictorNavarro


1 Answers

It's Google One-tap sign-up, it can be integrated using their API, follow this guide to setup Google One Tap in your website.

When you have added the Oauth2 ClientID in Google console. You would just use something like :

<!DOCTYPE html>
<html>
<head>
    <script src="https://accounts.google.com/gsi/client" async defer></script>
</head>
<body>
    <div id="g_id_onload"
        data-client_id="XXXXXXXXXXXX-bk2lj5rs6l4c6g23nmtsfdh66qhfu921.apps.googleusercontent.com"
        data-login_uri="https://localhost:3000/login"
    >
    </div>
</body>
</html>

and you would get :

enter image description here

like image 180
Bertrand Martel Avatar answered Sep 25 '22 15:09

Bertrand Martel