Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue with Twitter and Meteor

Tags:

meteor

I get the following error with Meteor (version 0.6.6.3) and clicking on the sign in button for 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

Anybody has an idea on how to solve this issue?

Thanks

like image 975
Ben Avatar asked Nov 14 '13 23:11

Ben


2 Answers

I had the same issue caused by manually removing and inserting the loginServiceConfiguration incorrectly. If you're not using the configuration tool, make sure you're inserting a consumerKey rather than clientId.

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

Accounts.loginServiceConfiguration.insert({
  service: "twitter",
  consumerKey: "...",
  secret: "..."
});
like image 110
mculp Avatar answered Sep 18 '22 13:09

mculp


Ok so after poking around for a while I finally made it work. Here's the workaround I found that could hopefully help others who get a similar error.

Setup

  • A local debian server running meteor, with IP address 192.168.2.100. Could be a virtualbox like in my case.
  • You are accessing the meteor app with your navigator on 192.168.2.100:3000 from your Windows computer
  • Connecting through the Twitter package does not work

Solution

  • In you windows host file setup your localhost as 192.168.2.100 instead of 127.0.0.1
  • In the Twitter app configuration enter for the callback http://192.168.2.100:3000/_oauth/twitter?close
  • You may have to wait or restart from scratch
like image 41
Ben Avatar answered Sep 20 '22 13:09

Ben