A proposal for delegation in OAuth identity verification
For a while now, we over at the Twitter API have been touting "OAuth, OAuth, OAuth". We really want to get people to switch over and stop using Basic Authentication when talking to our API in a production manner. Why? Basic Authentication is, simply, horribly insecure. On a protocol level, unless you are using SSL to talk to our servers, all it takes is somebody tcpdump-ing some of your packets, and Base-64 decoding your Authorization header. On an application level, it enables the password anti-pattern. There are a slew of shortcomings to OAuth and its adoption — Twitter is working to address a lot of them.
You're an OAuth enabled Twitter client, and you've already authorized your user. You user wants to use a media providing service like TwitPic. TwitPic, currently, asks for the username and password of your user so it can store the photo on behalf of the Twitter user. You don't have that username and password, so how do you give the ability to TwitPic to verify the identity of your user?
Comments (10)
Thanks for writing this up. Couple questions:
1) Could you give an example of a PR in that example? Would it be the URL of the to-be-uploaded pic? Or just the "upload" method in general?
2) I know this is just aimed at delegating authentication, but any thoughts on delegation of authorization? Currently the basic auth handles both (although in an obviously flawed way).
Feel better!
Since TwitPic would not be posting on behalf of the user TwitPic would lose some of the natural marketing of the "from application" link. Some applications could then find it less appealing to provide APIs that support delegation.
Also if the user has already authorized TwitPic and TwitPic has access_tokens stored it could be tempting for TwitPic to post on behalf of the user. This would only happen after the verification is successful but it could cause duplicate content if Tweetie then continues to posts.
The Consumer, prepares a verify-credentials HTTP request, signed with its OAuth token, and passes this URL to the delegator, which in turn will simply issue this request on the consumer's behalf.
Since a signed request doesn't contain the token-secrets, this is pretty safe to the consumer as well as end user.
Some more thoughts:
* Perhaps the plan is to scale this workflow to action delegation. In which case it makes sense to introduce the new flow.
* The term delegator is confusing. Shouldn't it be delegatee or something :)




This is a great first step. To get OAuth working in our app, heypic.me, we had to use an ugly workaround. Rather than using Twitpic or Yfrog for photos, we post images to ImageShack and set them as private, so they are not browsable via the ImageShack website.
One question: I assume in the flow you describe above, the Twitter update would display as "from Tweetie", not Twitpic, correct?
Thanks and keep it up,
Andrew