Ember Cli Authentication with node server and social logins

血红的双手。 提交于 2019-12-08 10:59:48

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/27874519/ember-cli-authentication-with-node-server-and-social-logins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!