Archive >  2009 >  February >  12 Previous / Next


Scripting News, the weblog started in 1997 that bootstrapped the blogging revolution.

Connecting with Twitter using OAuth Permanent link to this item in the archive.

Okay, so the easy part of OAuth is done, I have it connecting to the demo server. Now comes the part where I try to use it to control Twitter. That part, no surprise, isn't working -- yet. I will get it to work. I'm determined. ;->

This much does work.

1. I am able to get a request token.

2. I am able to direct the user to the page where they give the OPML Editor permission to use my account, and I am able to give the OPML Editor that permission.

3. The OPML Editor, waiting in the background, polling Twitter, determines that it has been given access, and saves the access key and the access secret in the database.

A picture named accordion.gifAll that happened in 5 minutes, so I was fairly confident that the next step would work, but blam I hit a brick wall and stopped right there. It's insisting that it cannot authenticate me.

4. Here's what I want to do, I want to ask Twitter for my friends' timeline. Before OAuth, you'd make a request of this URL, with nonsecure HTTP authentication, and it would return an XML structure that contains information about recent status updates from the people the user is following. I make the request using the same code I used to make the request of the Irish server, the request that worked, but I get back the following result from Twitter: "Invalid OAuth Request."

I'm doing something wrong but damn if I know what it is! ;->

PS: Here's the current OAuth app table, for the gutsy Frontier programmers.

OAuth hail mary quick code clinic and plea for help Permanent link to this item in the archive.

Hi everybody!

As you probably know Twitter is getting ready to support OAuth, and this is a good thing, cause it'll make it easier to trust websites with access to your account cause you won't have to give up your password. But OAuth is hard to implement, it's complicated, and because I'm basically programming the OPML Editor on my own, if I want to support it, I have to write the code. Which is okay cause it's interesting, and it'll mean I'll have a very deep background in OAuth when it's done.

I've been through one of these before. Flickr has a similar authentication system, although it's simpler than OAuth (probably fewer cooks and less compromise in the design). So last night I got coding finally and made a lot of progress, thanks to some help from a tutorial at Hueniverse. But as I was finishing it up I was pretty sure it wouldn't work when I tested it against a server running in Ireland, and sure enough it didn't.

At this point what you do is put up a source listing ahd ask other programmers to have a look. I bet there are a dozen things I'm not doing that I should be. Based on Leah Culver's code, I think I may have to set some headers, but I'm not doing any of that. What else?

Anyway, here's the listing.

http://scripting.com/misc/programming/oauthlisting.txt

Gratitude for any help will be psychically and demonstrably expressed! ;->

A picture named accordion.gifUpdate at 11:50AM: I got signatures working. Here's the updated code listing. How I did it was to fill in the values in the Hueniverse tutorial and step through my code and check my values against theirs. There were differences. Where they disagreed, I made mine match theirs. Once I got them producing the same signature, I tested it against the server in Ireland and it worked. Anyone who's trying to get theirs to work, I recommend doing the same. It takes all the guesswork out of it. Now I have to step through the rest of the dance and see how it goes. ;->

Update at 12:45PM: I'm done with my OAuth library, I've worked through all the levels with the test server in Ireland, and have made arbitrary authenticated calls. I even see roughly how this will plug into Twitter. It means rewriting all my glue code, but should not effect any of the higher-level code. After a break I'll get started testing against twitter.com.

     

Last update: Thursday, February 12, 2009 at 5:51 PM Pacific.



A picture named dave.jpgDave Winer, 53, pioneered the development of weblogs, syndication (RSS), podcasting, outlining, and web content management software; former contributing editor at Wired Magazine, research fellow at Harvard Law School, entrepreneur, and investor in web media companies. A native New Yorker, he received a Master's in Computer Science from the University of Wisconsin, a Bachelor's in Mathematics from Tulane University and currently lives in Berkeley, California.

"The protoblogger." - NY Times.

"The father of modern-day content distribution." - PC World.

One of BusinessWeek's 25 Most Influential People on the Web.

"Helped popularize blogging, podcasting and RSS." - Time.

"The father of blogging and RSS." - BBC.

"RSS was born in 1997 out of the confluence of Dave Winer's 'Really Simple Syndication' technology, used to push out blog updates, and Netscape's 'Rich Site Summary', which allowed users to create custom Netscape home pages with regularly updated data flows." - Tim O'Reilly.

http://twitter.com/davewiner

Dave Winer Mailto icon

My most recent trivia on Twitter.

My Amazon.com Wish List

On This Day In: 2008 2007 2006 2005 2004 2003 2002 2001 2000 1999 1998.

February 2009
Sun
Mon
Tue
Wed
Thu
Fri
Sat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Jan   Mar

Click here to see a list of recently updated OPML weblogs.

Click here to read blogs commenting on today's Scripting News.

Morning Coffee Notes, an occasional podcast by Scripting News Editor, Dave Winer.



Click here to see an XML representation of the content of this weblog.

Click here to view the OPML version of Scripting News.



© Copyright 1997-2009 Dave Winer.


Previous / Next