Hi,
Would appreciated some assistance with this.

I'm using the Python code below to do HMAC-SHA1 encoding for generated
basestrings. I've gotten it to work perfectly with Twitter's OAuth
API, but when I try to do it with Google's OAuth Data API, I
consistently get a signature_invalid error.

I went to check this out on the OAuth Playground website (http://
googlecodesamples.com/oauth_playground/) and found that I could not
replicate the signatures that the page was generating even if I just
took their basestring verbatim. Has anyone had a similar problem? I've
attached my code below as I'm scratching my head as to why this is
happening...

from hashlib import sha1
from hmac import new as hmac
from urllib import quote as urlquote

def encodeBaseString(base_string, consumer_secret, token_secret = ''):
    key = '%s&%s' % (consumer_secret, token_secret)

    signature = hmac(key, base_string, sha1)
    encoded =   signature.digest().encode('base64').strip()

    return encoded

Let me know if I should attach additional code, but I really have no
idea what's going on.
--Ben

-- 
You received this message because you are subscribed to the Google Groups 
"OAuth" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/oauth?hl=en.

Reply via email to