views:

130

answers:

1

I am consuming Twitter's REST APIs on Android to get a user's status timeline and for updating a user status. I am using Apache's HTTPClient class for this that is bundled with Android SDK. The user enters his/her credentials and I am saving it in String variables.

Everytime I need to invoke an API that require authentication, I pass these Credentials to my HTTPClient and create appropriate HTTP POST and GET requests as required.

I have a few questions about this approach:

  1. For methods that require Authentication, I am setting userName and password in the fields of Credentials class. Does the HTTPClient class include this data in an HTTP "Authorization" header? Is this an example of Basic Authorization?

  2. It was said that Twitter would be deprecating the use of Basic Authentication in June 2010. How would that affect my code? Will it break? Will passing userName and password in Credentials not work post June?

Thanks.

A: 

Yes as far as I know Twitter will require OAuth to be used to sign requests in June 2010. That means basic authentication will no longer work so you shouldn't even bother with using their RESTful api without using OAuth.

Here is an example of using OAuth on android to use the twitter api.

BrennaSoft