Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


client.authorized? returns false for valid clients #38

arbesulo opened this Issue · 5 comments

4 participants



I'm having problems with the client.authorized? method. I have realized that returns false even when the client is a valid one. Here are the last steps of my client set up:

client ={:consumer_key => config.consumer_key, :consumer_secret => config.consumer_secret, :token => access_token.token, :secret => access_token.secret }

=> false

{"id"=>256373778823671808, .... }

This was working until recently... did I miss some update?
Thanks in advance!


Hi, I actually have the exact same problem and have been struggling with this all afternoon. Today all of a sudden we can no longer use our twitter connect button because of a 401 Unauthorized response gotten from this line :

  @access_token = @client.authorize(twitter_session[:temporary_token], twitter_session[:temporary_secret], {
    :oauth_verifier => params[:oauth_verifier]

We have correctly configured a callback url in our twitter App (the connect used to work perfectly until today).

Just to make things clear, our workflow is the following :

First we do :

@client =
      :consumer_key => SocialNetworkConfig.twitter.consumer_key,
      :consumer_secret => SocialNetworkConfig.twitter.consumer_secret
 request_token = @client.authentication_request_token(:oauth_callback => create_twitter_session_url(:protocol => "http#{'s' if Rails.env.production?}"))

 twitter_session[:temporary_token] = request_token.token
  twitter_session[:temporary_secret] = request_token.secret

  redirect_to request_token.authorize_url

Then once the app has been authorized via twitter :

@client ={
    :consumer_key => SocialNetworkConfig.twitter.consumer_key,
    :consumer_secret => SocialNetworkConfig.twitter.consumer_secret

  @access_token = @client.authorize(twitter_session[:temporary_token], twitter_session[:temporary_secret], {
    :oauth_verifier => params[:oauth_verifier]


The last line returns false when we have perfectly valid users that are known to have accepted permissions. Through our debugging we have determined that the issue does not come from our code, maybe Twitter changed the way it's communicating this type of info ?

Thanks again for any help you can provide ! Take care


We've also had this problem since morning. Changing the path in TwitterOauth::Client.authorized? "/1/account/verify_credentials.json" fixed it.


I see, to change this you had to unpack, modify and then rebuild the gem ?


Just pushed v0.4.4 with this fix in. Thanks!

@moomerman moomerman closed this

It works perfectly now, thanks for your fast reaction :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.