DEV Community

qian
qian

Posted on

how to add Google login remind popup to web application

  1. import google script
<script src="https://accounts.google.com/gsi/client" async></script> 
Enter fullscreen mode Exit fullscreen mode

https://developers.google.com/identity/gsi/web/guides/client-library?hl=zh-cn

  1. add dom
<div id="g_id_onload" data-client_id="YOUR_GOOGLE_CLIENT_ID" data-login_uri="https://your.domain/your_login_endpoint" data-your_own_param_1_to_login="any_value" data-your_own_param_2_to_login="any_value"> </div> 
Enter fullscreen mode Exit fullscreen mode

https://developers.google.com/identity/gsi/web/guides/display-google-one-tap?hl=zh-cn

how the code looks like

Image description

how the web page looks like

Image description

Top comments (0)