I use the gem of Twitter (https://github.com/jnunemaker/twitter). Keep getting Twitter :: Error :: Unauthorized, with only a few users. For other users, the request is executed without any problems.
user = User.first client = Twitter::Client.new(:oauth_token => user.authentications.where(:provider => 'twitter').first.token, :oauth_token_secret => user.authentications.where(:provider => 'twitter').first.secret) client.follower_ids
Exact error: Twitter::Error::Unauthorized: This method requires authentication.
This happens on a case by case basis. The problem affects a number of users in our system. The first thing you might think is that their oauth_token and oauth_token_secret may be invalid. I store these tokens in the same way that I store tokens for each user. Therefore, there is no reason to suspect that tokens may be invalid.
Does anyone know why?
source share