简体   繁体   English

如何获取 Chrome 登录用户信息

[英]How to get Chrome Logged in User information

I am developing a Web application where I am making users sign-in with Google.我正在开发一个 Web 应用程序,让用户在其中使用 Google 登录。 Just to add a courtesy, I want to show them their email if they are already logged in to Chrome.只是为了增加礼貌,如果他们已经登录到 Chrome,我想向他们展示他们的电子邮件。 How can I fetch if user is logged in to Chrome and what is his email?如果用户登录到 Chrome,我如何获取他的电子邮件?

First you will need to register an app with the google console .首先,您需要在google 控制台上注册一个应用程序。 You will then have to use the googleapis in the browser to log in as well and after the user has given your app the permissions you can fetch their details.然后,您还必须使用浏览器中的googleapis进行登录,在用户授予您的应用权限后,您可以获取他们的详细信息。

A lot more information here: https://developers.google.com/identity/protocols/oauth2/javascript-implicit-flow这里有更多信息: https : //developers.google.com/identity/protocols/oauth2/javascript-implicit-flow

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM