CLI的灰烬与认证节点服务器和社会登录 [英] Ember Cli Authentication with node server and social logins
问题描述
我建立一个余烬CLI应用程序,我想知道什么是用户认证和授权的最佳方法。
I am building a ember cli app and I would like to know what is the best approach for user authentication and authorization.
我 HTTPS拨弄左右//github.com/simplabs/ember-simple-auth
的https://github.com/simplabs/ember-simple-auth/tree/master/packages/ember-simple-auth-torii
随着它像Facebook和Gmail社会AUTH。
但是,什么情况是客户端(emberjs)发送请求给Facebook / Gmail应用程序,回来的令牌。
但是,这令牌是在客户端和我的服务器不知道所接收到的标记
。
问题 - 如何让服务器知道在客户机上接收到的令牌(烬JS)
along with it for social auth like facebook and gmail.
But what happens is client(emberjs) sends request to facebook/gmail app and gets back a token.
But this token is on the client side and my server does not know about the received token
.
Question - How do I make the server aware of the token received on the client(ember js) ?
应该用什么方法,如果在我的余烬程序,我想包括我的节点通信的后端,并得到一个令牌,并自定义登录,以及我希望能够通过Facebook / gmial登录。 ?
What should be the approach if on my ember app I want to include custom login that communicates with my node backend and gets a token and as well as I want to be able to login via facebook/gmial. ?
我要寻找一个统一的,无缝的登录解决方案,与Ember CLI效果很好。
I am looking for a unified and seamless login solution that works well with ember cli
推荐答案
请参阅这个问题:<一href=\"http://stackoverflow.com/questions/25821982/workflow-for-ember-simple-auth-torii-and-facebook-oauth2\">Workflow为灰烬简单的-auth的,鸟居和Facebook的oauth2
您只需定义一个自定义的验证器(你也可以覆盖牌坊认证作为反对的OAuth 2.0认证作为回答)首先从牌坊获得令牌,然后在<$ C $它发布到自己的服务器C>验证方法。
You simply define a custom authenticator (you could also override the torii authenticator as opposed to the OAuth 2.0 authenticator as in the answer) that first gets the token from torii and then posts it to your own server in the authenticate
method.
这篇关于CLI的灰烬与认证节点服务器和社会登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!