[英]How to authenticate google user using node.js
I am using node.js
for my application and I have to do user authentication via google. 我使用
node.js
作为我的应用程序,我必须通过谷歌进行用户身份验证。 I have seen passport-google
module but I did not get any idea from that and there is no variable for username and password. 我已经看过
passport-google
模块,但我没有从中得到任何想法,并且没有用户名和密码的变量。
One thing is that My application is desktop application . 有一点是我的应用程序是桌面应用程序。
You can either do it through OAuth or OpenID for both cases there are very detail examples on passport.js what else you need 你可以通过OAuth或OpenID来做这两种情况,在passport.js上有非常详细的例子你需要什么
for OAuth Example https://github.com/jaredhanson/passport-google-oauth/blob/master/examples/oauth2/app.js for OAuth示例https://github.com/jaredhanson/passport-google-oauth/blob/master/examples/oauth2/app.js
for OpenID Example (deprecated) https://github.com/jaredhanson/passport-google/blob/master/examples/signon/app.js for OpenID Example(不建议使用) https://github.com/jaredhanson/passport-google/blob/master/examples/signon/app.js
I think they are quite self explantory.. 我认为他们是非常自我解释的..
googleapis
模块支持OAuth 2.0, https://github.com/google/google-api-nodejs-client/blob/master/examples/oauth2.js上有一个示例
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.