简体   繁体   English

登录后使用ember-simple-auth连接到社交网络

[英]using ember-simple-auth to connect to Social Networks after logging in

We have our own Ember to Api login working, using ember-simple-auth, and jwt. 我们使用ember-simple-auth和jwt拥有自己的Ember到Api登录功能。 In addition, we also want to connect to Facebook and additional third party social networks. 此外,我们还希望连接到Facebook和其他第三方社交网络。

We are able to connect and auth to facebook using ember-simple-auth and a torii provider. 我们能够使用ember-simple-auth和torii提供程序连接并验证到Facebook。

2 problems. 2个问题。

1) If the facebook (or other third party auth) popup is closed or canceled, the session is invalidated and the user is logged out. 1)如果关闭了Facebook(或其他第三方auth)弹出窗口,则该会话无效,并且用户已注销。 2) if the user connects to a fb account that is already associated with a email used by another user (think social media company page), the session is invalidated and the user is logged out. 2)如果用户连接到已经与另一个用户使用的电子邮件相关联的fb帐户(请考虑社交媒体公司页面),则该会话无效,并且该用户已注销。

Both of these behaviors is fine if the user was logging into your application, but in this case I would like to catch the error (which I can do, some what), report that, and continue the original session. 如果用户登录到您的应用程序,这两种行为都很好,但是在这种情况下,我想捕获错误(我可以做的,有什么措施),报告该错误并继续原始会话。

Any suggestion how to do that? 有什么建议怎么做?

using : Ember: 2.11.3 ; 使用:灰烬:2.11.3; Ember Simple Auth: 1.2.2 and torii : 0.8.2 灰烬简单身份验证:1.2.2和torii:0.8.2

If you're not using Facebook as part of your app login auth I would probably look at creating a separate service to handle the facebook auth interactions. 如果您不使用Facebook作为应用程序登录身份验证的一部分,我可能会考虑创建一个单独的服务来处理Facebook身份验证交互。 It sounds like the issue is probably due to the ember-simple-auth authenticator invalidating your session on the reject response and causing a conflict. 听起来问题可能是由于ember-simple-auth身份验证器使您在拒绝响应上的会话无效并引起冲突。

Something like https://github.com/pitchtarget/ember-cli-facebook-js-sdk would allow you to setup a service that interacts directly with the Facebook auth without affecting your app login state. https://github.com/pitchtarget/ember-cli-facebook-js-sdk之类的东西将允许您设置直接与Facebook auth交互的服务,而不会影响您的应用程序登录状态。

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

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