【发布时间】:2015-07-01 03:56:34
【问题描述】:
我正在我的应用中实现邀请人,我想使用谷歌联系人,
如果我使用accounts-google包来验证用户,这将是一个复杂的过程,因为我不想存储用户信息,
我只想要一次身份验证,所以我正在寻找客户端解决方案,
var url='https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/contacts.readonly&client_id=5558545-3n8vg6u4nu2hm1gmuj1dbjib28p33qss.apps.googleusercontent.com&redirect_uri=http://localhost:3000/_oauth/google&response_type=token'
var newWindow = window.open(url, 'name', 'height=600,width=450');
点击邀请按钮后,我称它运行良好,但如何阅读此窗口返回的accesstoken。
我找不到怎么做?
我尝试使用HTTP 方法
HTTP.get(url, {}, function(e,r){
console.log(e,r);
});
但它抛出错误,它不工作。
如何从弹出窗口中读取 accesstoekn?或者有没有其他方法可以做到这一点?
【问题讨论】:
标签: javascript meteor oauth google-oauth