简体   繁体   English

如何在Ember Simple Auth中使用Facebook OAuth?

[英]How to use Facebook OAuth with Ember Simple Auth?

I have an Ember.js app using Ember Simple Auth. 我有一个使用Ember Simple Auth的Ember.js应用程序。 The API returns an auth token on successful sign in with email and password. API成功登录后将使用电子邮件和密码返回身份验证令牌。 I'm trying to add Facebook Login using their Javascript SDK. 我正在尝试使用他们的Javascript SDK添加Facebook登录。 Upon successful sign in with Facebook, I would like to post the Facebook access token back to our API, so that the API can store the access token and respond with our own auth token. 在成功登录Facebook之后,我想将Facebook访问令牌重新发布回我们的API,以便API可以存储访问令牌并使用我们自己的身份验证令牌进行响应。 However, I'm not sure how to connect this to Ember Simple Auth so that the auth token can be stored outside of the normal email/password sign in. What do I need to do in order to make this work? 但是,我不确定如何将其连接到Ember Simple Auth,以便可以将auth令牌存储在正常的电子邮件/密码登录之外。为了使此工作有效,我需要做什么?

The dummy app in the repository implements the exact functionality you're describing (except it uses torii instead of the Facebook JS SDK). 存储库中虚拟应用程序实现了您正在描述的确切功能(除了它使用torii而不是Facebook JS SDK外)。 If you're using Rails on the server you might find the RailsApiAuth engine helpful that already implements the server part for the Facebook auth code flow. 如果您在服务器上使用Rails,则可能会发现RailsApiAuth引擎很有帮助,该引擎已经实现了Facebook身份验证代码流的服务器部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM