Error getting request token

595 views
Skip to first unread message

Jeff Jolma

unread,
May 16, 2013, 6:12:39 PM5/16/13
to tumbl...@googlegroups.com
Hello.

Did something change recently with obtaining a request token?  Today this stopped working for us.  Example ruby:

require 'rubygems'
require 'oauth'
TUMBLR_CONSUMER_KEY = 'real key goes here'
TUMBLR_CONSUMER_SECRET = 'real secret goes here'
consumer = OAuth::Consumer.new(TUMBLR_CONSUMER_KEY, TUMBLR_CONSUMER_SECRET, :site => 'http://api.tumblr.com')
request_token = consumer.get_request_token

# response: 400 Bad Request 

Thanks,
Jeff

John Bunting

unread,
May 16, 2013, 6:27:20 PM5/16/13
to tumbl...@googlegroups.com
It seems like that the oauth gem default sets oob which is not implemented for our API (and never has been). You'll need to make sure you use this code:

consumer.get_request_token(:exclude_callback => true)

Strange that you say it worked for you before, because it most certainly shouldn't have.

Thanks




--
You received this message because you are subscribed to the Google Groups "Tumblr API Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tumblr-api+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
John Bunting

Simplicity is prerequisite for reliability
    --Edsger W. Dijkstra

Jeff Jolma

unread,
May 16, 2013, 6:59:21 PM5/16/13
to tumbl...@googlegroups.com
That works. Thank you.

Jeff Jolma

unread,
Jun 6, 2013, 5:19:45 PM6/6/13
to tumbl...@googlegroups.com
Did something change recently.  The same code (including your suggested fix) no longer works for us:

require 'rubygems'
require 'oauth'
TUMBLR_CONSUMER_KEY = 'real key goes here'
TUMBLR_CONSUMER_SECRET = 'real secret goes here'
consumer = OAuth::Consumer.new(TUMBLR_CONSUMER_KEY, TUMBLR_CONSUMER_SECRET, :site => 'http://api.tumblr.com')
request_token = consumer.get_request_token(:exclude_callback => true)

# response: OAuth::Unauthorized: 404 Not Found

Thanks,
Jeff 

John Bunting

unread,
Jun 6, 2013, 6:47:50 PM6/6/13
to tumbl...@googlegroups.com

Are you requesting your request tokens on API.tumblr.com? Documentation says you need to use www.tumblr.com

Jeff Jolma

unread,
Jun 6, 2013, 6:50:42 PM6/6/13
to tumbl...@googlegroups.com
Yeah, api.tumblr.com wasn't working at one point and www.tumblr.com was.  This works for now, so we'll switch.

Thanks,
Jeff

Rayban

unread,
Jun 21, 2013, 5:18:03 PM6/21/13
to tumbl...@googlegroups.com
Thank you, this fixed my problem as well! It was working before, so I'm not sure what recently changed... 
Oh well, thanks! :)

Rayban

unread,
Jun 22, 2013, 2:50:13 PM6/22/13
to tumbl...@googlegroups.com
Hi-
I am now able to obtain a request token, and I even can get an access token, but I can't post anymore. This was working through June 14, 2013. 
Did something change between the 14th and the 20th of this month? 

The exclude_callbacks parameter on the request token allowed me to get a new request token. I assume that my access token had expired and I got a new one, however I still can't make any posts. Any insights on what else could have changed? I'm getting a 401 unauthorized when attempting to create a post. GET requests work without issue. 

To see the code I'm using, check out this ruby gem: https://github.com/forthemakers/tumblr_wrapper

I can make any necessary updates on the gem as it's my repo. 

Thanks, 
Rachel Heaton

John Bunting

unread,
Jun 22, 2013, 3:02:14 PM6/22/13
to tumbl...@googlegroups.com

Are you trying to post to a blog that you don't have access to?

If you want to try our official gem, http://github.com/tumblr/tumblr_client, you might have better luck.

Thanks!

--

Rayban

unread,
Jun 27, 2013, 4:20:25 PM6/27/13
to tumbl...@googlegroups.com
I will try out the official gem, but I have no idea what could have changed with respect to access on three different blogs... Were there any API changes? 

John Bunting

unread,
Jun 27, 2013, 4:24:25 PM6/27/13
to tumbl...@googlegroups.com
Sorry! I looked a little more in depth at the code you've written here.

So looking at your request, you're trying to get/send a request token to http://api.tumblr.com

The documentation states that you need to do this to http://www.tumblr.com. Once you get valid tokens from the three-legged walk, you can then issue fully oauthed requests to api.tumblr.com

Thanks 

Rayban

unread,
Oct 8, 2013, 6:40:59 PM10/8/13
to tumbl...@googlegroups.com
I tried out the official gem and I am still getting 401s. (This feature was pushed way down our backlog, so I'm back looking at it now). 

Mostly, I am curious as to what could possibly has changed on your end in June that broke my code. It was working fine until June 14, 2013, and I made no changes. 

I think I was using the www.tumblr.com and not api.tumblr.com to get the oauth token (the consumer is given www): https://github.com/forthemakers/tumblr_wrapper/blob/master/lib/tumblr_wrapper/client.rb#L35

Any ideas would be great. Maybe I am just formatting my request incorrectly. Was there some stricter request validation added in June?

John Bunting

unread,
Oct 8, 2013, 8:14:38 PM10/8/13
to tumbl...@googlegroups.com
So silly question, but have you tried registering a new key and trying it with that? Email api @ tumblr.com with your consumer key and I can see if we have suspended your app. By any chance is your verifier coming back like this: 

<big string of numbers and such>#_=_

And when you pass the verifier back into your code, are you including the #_=_? If so, strip that off. It's a way for us to protect from redirection hijacks and shouldn't be used in the verifier.
Reply all
Reply to author
Forward
0 new messages