简体   繁体   English

Meteor.js:将Twitter和Facebook链接到基于密码的帐户

[英]Meteor.js: Linking Twitter and Facebook to a Password based account

I'm currently trying to set up my application in such a way that users can connect their Twitter, and/or Facebook accounts to their password based account within my application. 我目前正在尝试以这样的方式设置我的应用程序,即用户可以将他们的Twitter和/或Facebook帐户连接到我的应用程序中的基于密码的帐户。

I've built a custom account system on top of accounts-ui-unstyled , and I have both accounts-twitter , accounts-facebook, and meteor-link-accounts installed, and I've tried many different things, but none of them seem to work. 我在账户上建立了一个自定义帐户系统- ui-unstyled ,我安装了账户 - twitter ,账户 - facebook和meteor-link-accounts ,我尝试了很多不同的东西,但都没有似乎工作。

All I need to have happen is on button click, let a user sign in with twitter, and once signed in, update the current user with that account being linked. 我需要做的就是按下按钮,让用户使用Twitter登录,登录后,使用该链接的帐户更新当前用户。 Ideally once that happens, you'd be able to reclick that same button to undo the link. 理想情况下,一旦发生这种情况,您就可以重新点击相同的按钮来撤消链接。

Does anyone have experience doing this? 有没有人有这方面的经验? Should I use different packages? 我应该使用不同的套餐吗?

I was working through this problem today. 我今天正在解决这个问题。 Take a look at this gist 看看这个要点

Add this to your server code, you'll get the functionality you want. 将其添加到您的服务器代码中,您将获得所需的功能。 Also for security make email verification on all accounts mandatory. 此外,为了安全起见,还必须对所有帐户进

What you are describing is actually built in functionality of the meteor accounts API. 您所描述的内容实际上是在meteor accounts API的功能中构建的。 ( http://docs.meteor.com/#accounts_api ) But it sounds, from your description, that you are already using that. http://docs.meteor.com/#accounts_api )但从您的描述中可以看出,您已经在使用它了。

Working with Twitter and Facebook for login, you do have to register your application with Twitter and Facebook for the oauth to work. 使用Twitter和Facebook进行登录,您必须在Twitter和Facebook上注册您的应用程序才能使用oauth。 Did you do that? 是你做的吗? What are your specific errors? 你有什么具体的错误?

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

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