【发布时间】:2015-01-13 08:34:30
【问题描述】:
我正在使用 Ember CLI + ember simple auth torii link
从 Facebook 获取我的 ember 应用的身份验证代码。
这是我的environment.js 文件
ENV['torii'] = {
providers: {
'facebook-oauth2': {
apiKey: '865549306850377',
scope: 'email',
//redirectUri: window.document.location.href
redirectUri: 'http://localhost:4200/'
}
}
};
我的登录控制器看起来像这样 -
facebook: function() {
var _this = this;
this.get('session').authenticate('simple-auth-authenticator:torii', 'facebook-oauth2').then(function(data){
console.log("status - ", _this.get('session'));
});
}
还有 login.hbs -
<li><button {{action "facebook" "facebook-oauth2"}}>Facebook OAuth2</button></li>
用户点击链接后,会打开一个 facebook 弹出窗口,并且 ember 应用会获得一个令牌。
如何获取 用户的电子邮件 ID 以及此令牌? 有没有人遇到过类似的问题?
【问题讨论】:
标签: facebook authentication ember.js ember-simple-auth