Twitter和Meteor的问题

Ben*_*Ben 6 meteor

我在Meteor(版本0.6.6.3)中点击了以下错误并点击了Twitter的登录按钮.

I2038-06:13:28.670(-8)? Exception while invoking method 'login' Error: Failed to send OAuth1 request to https://api.twitter.com/oauth/request_token. failed [401] Failed to validate oauth signature and token
I2038-06:13:28.673(-8)?     at OAuth1Binding._call (packages/oauth1/oauth1_binding.js:143)
I2038-06:13:28.674(-8)?     at OAuth1Binding.prepareRequestToken (packages/oauth1/oauth1_binding.js:27)
I2038-06:13:28.675(-8)?     at Oauth._requestHandlers.(anonymous function) (packages/oauth1/oauth1_server.js:21)
I2038-06:13:28.676(-8)?     at middleware (packages/oauth/oauth_server.js:105)
I2038-06:13:28.677(-8)?     at packages/oauth/oauth_server.js:78
Run Code Online (Sandbox Code Playgroud)

有人知道如何解决这个问题吗?

谢谢

mcu*_*ulp 7

我有错误地手动删除和插入loginServiceConfiguration导致同样的问题.如果您没有使用配置工具,请确保您正在插入consumerKey而不是clientId.

Accounts.loginServiceConfiguration.remove({
  service: "twitter"
});

Accounts.loginServiceConfiguration.insert({
  service: "twitter",
  consumerKey: "...",
  secret: "..."
});
Run Code Online (Sandbox Code Playgroud)


Ben*_*Ben 3

好吧,经过一段时间的摸索,我终于成功了。这是我发现的解决方法,希望可以帮助其他遇到类似错误的人。

设置

  • 运行meteor的本地debian服务器,IP地址192.168.2.100。可能是像我这样的虚拟机。
  • 您正在 Windows 计算机上使用导航器在 192.168.2.100:3000 上访问 Meteor 应用程序
  • 通过 Twitter 包连接不起作用

解决方案

  • 在 Windows 主机文件中将 localhost 设置为 192.168.2.100 而不是 127.0.0.1
  • 在 Twitter 应用程序配置中输入回调http://192.168.2.100:3000/_oauth/twitter?close
  • 您可能需要等待或从头开始