I misunderstood your question.
The order of the parameters in the OAuth header DOES matter
http://oauth.net/core/1.0/#anchor14
You should just use a library to take care of this step though. I've
used:
http://code.daaku.org/python-oauth/
I posted some code about this here:
http://tipjoy.com/api/#authentication
In the code below, oauth_request.to_header will call compose_qs from
the urlencoding lib. The compose_qs call sorts the authorization
parameters
http://github.com/nshah/python-urlencoding/blob/fafc630f3368559488dcb23dd4859669389a2a6f/urlencoding/__init__.py#L54
from oauth import OAuthRequest # from
http://code.daaku.org/python-oauth/
from oauth.signature_method.hmac_sha1 import
OAuthSignatureMethod_HMAC_SHA1
def get_oauth_header(oauth_token, oauth_token_secret,
twitter_consumer_key, twitter_consumer_secret):
url = '
http://twitter.com/account/verify_credentials.json'
consumer = {'oauth_token': twitter_consumer_key,
'oauth_token_secret': twitter_consumer_secret}
token = {'oauth_token': oauth_token, 'oauth_token_secret':
oauth_token_secret }
oauth_request = OAuthRequest( url )
oauth_request.sign_request(OAuthSignatureMethod_HMAC_SHA1,
consumer, token=token)
return oauth_request.to_header()
If you're not doing this, the header will likely be invalid.
You can test for yourself if the header is valid. Here is the code I
use:
def twitter_verify_credentials_3rd_part_oauth( auth_header ):
page_request = urllib2.Request( '
http://twitter.com/account/
verify_credentials.json', headers={'Authorization' : auth_header} )
try:
return json.read( urllib2.urlopen(page_request).read() )
except:
return False
return False
Ivan
http://tipjoy.com
On Jun 1, 8:12 pm, Ivan Kirigin <
ivan.kiri...@gmail.com> wrote:
> I added id's to know where in the code the error occurs.
>
> The order of params doesn't matter.
>
> I'll take a look at the issues later tonight.
>
> Ivan
> via iphonehttp://tipjoy.com617-777-4317
>