Ember Cli身份验证与节点服务器和社会登录 [英] Ember Cli Authentication with node server and social logins

查看:131
本文介绍了Ember Cli身份验证与节点服务器和社会登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在建立一个ember cli应用程序,我想知道用户身份验证和授权的最佳方法是什么。 https://github.com/simplabs/ember-simple-auth/tree/master/packages/ember-simple-auth-torii =nofollow> https://github.com/simplabs/ember-simple -auth



https://github.com/simplabs/ember-simple-auth/tree/master/packages/ember-simple-auth-torii



以及Facebook和Gmail等社交认证。
但是会发生什么事情是客户端(emberjs)向facebook / gmail应用程序发送请求并返回一个令牌。
但这个令牌是在客户端,我的服务器不知道收到的令牌
问题 - 如何使服务器了解客户端上收到的令牌(ember js)?



如果在我的ember应用程序上应该怎么办我想包括与我的节点后端通信的自定义登录,并获得一个令牌,以及我想要能够通过Facebook / gmial登录。 ?



我正在寻找一种统一无缝的登录解决方案,适用于ember cli

解决方案

看到这个问题: Ember工作流程-simple-auth,Torii和Facebook Oauth2



您只需定义一个自定义验证器(您也可以覆盖torii验证器,而不是OAuth 2.0验证器在答案中)首先从torii获取令牌,然后在验证方法中将其发布到您自己的服务器。


I am building a ember cli app and I would like to know what is the best approach for user authentication and authorization.

I fiddled around with https://github.com/simplabs/ember-simple-auth

https://github.com/simplabs/ember-simple-auth/tree/master/packages/ember-simple-auth-torii

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) ?

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. ?

I am looking for a unified and seamless login solution that works well with ember cli

解决方案

See this question: Workflow for Ember-simple-auth, Torii and Facebook Oauth2

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.

这篇关于Ember Cli身份验证与节点服务器和社会登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆