Hi - I’m working on a Ruby & Rails app which uses the “oauth” gem to connect with twitter. Everything works correctly for most twitter accounts, however we’ve noticed that for newly created twitter accounts, the oauth flow breaks when exchanging the oauth_verifier for an access_token. This is the response from twitter:
content-length: 25
content-type: text/html; charset=utf-8
date: Thu, 06 Jun 2013 19:51:47 GMT
expires: Tue, 31 Mar 1981 05:00:00 GMT
last-modified: Thu, 06 Jun 2013 19:51:47 GMT
pragma: no-cache
server: tfe
set-cookie: _twitter_sess=BAh7BzoPY3JlYXRlZF9hdGwrCHaGCxs%252FAToHaWQiJWNhZjU4ZjZiMzNmODIx%250ANWQ4MzE4YTAyMjRjOWUwMDVh–bef371b159707078655cc4b9b7447936ef097a43; domain=.twitter.com; path=/; HttpOnly, guest_id=v1%3A137054830743920770; Domain=.twitter.com; Path=/; Expires=Sat, 06-Jun-2015 19:51:47 UTC
status: 401 Unauthorized
strict-transport-security: max-age=631138519
vary: Accept-Encoding
x-frame-options: SAMEORIGIN
x-mid: ec88e88aa580c48bc2d18bbe438ce6031728e179
x-runtime: 0.01115
x-transaction: b59dee50af6ed8e7
x-ua-compatible: IE=9,chrome=1
x-xss-protection: 1; mode=block
connection: close
Failed to exchange tokens
The interesting thing is that I can’t find any reference of the “Failed to exchange tokens” response anywhere. And again, this is only happening with brand new twitter accounts. If you create a new account and get this message and then try again immediately, it works fine.