我正在寻找 Meteor.loginWithGoogle 的工作示例(使用meteor 0.6.4.1)。
我找到了这个用于 loginWithGitHub 的(https://www.eventedmind.com/posts/meteor-customizing-login)与 GitHub 配合良好。
它在没有参数的情况下工作正常,如客户端所示:
Template.user_loggedout.events({
"click #login": function(e, tmpl){
Meteor.loginWithGoogle({
}, function (err) {
if(err) {
//error handling
alert('error : '+err.message);
} else {
}
});
}
});
使用服务器端的帐户参数:
Accounts.loginServiceConfiguration.remove({
service: 'google'
});
Accounts.loginServiceConfiguration.insert({
service: 'google',
clientId: 'XXXXXX',
secret: 'YYYYYY'
});
在这种情况下,我如何获取当前用户信息,尤其是邮件?
有没有办法获取用户的 Google+ 个人资料(如果他有并允许这样做),例如用户的头像?
requestPermissions: 需要哪些参数,我能用它得到什么?
Thanks
经过一番研究后,我在这里构建了自己的示例:https://github.com/lc3t35/googlelogin
谢谢 :
https://github.com/m2web/githublogin
https://github.com/ananta-IO/marq
Meteor/MongoDB 看到可用于发布的字段吗?
https://github.com/mrtnbroder/meteor-snippets/blob/master/snippets/js/Accounts/loginWithGoogle.sublime-snippet
https://developers.google.com/accounts/docs/OAuth2Login#obtaininguserprofileinformation
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)