Hello,

I've been trying to implement OAuth in my app for several days, but no
luck there.. Some of my AuthGetAccessToken requests are executed well,
but some of them fail with signature_invalid error. I noticed that
this is probably due to space or '+' sign encoding problems, for
example this request has been executed without any errors (base
strings here):

GET&https%3A%2F%2Fwww.google.com%2Faccounts
%2FOAuthGetAccessToken&oauth_consumer_key%3Dist-server-
v2.isportstracker.com%26oauth_nonce
%3Ded2a8b3fdd62ba33d80c0c126dfadea0%26oauth_signature_method%3DHMAC-
SHA1%26oauth_timestamp%3D1252311137%26oauth_token
%3D4%252FXmH9kCIscvgsFxAi8s-4j5A2il6H%26oauth_token_secret
%3DvCTgf4M3NfBr0rH1pICerH7G%26oauth_verifier%3DZgEw6OAQCEV7zev2PuHfBJuG
%26oauth_version%3D1.0


But this one returned signature_invalid (note %252B in
oauth_token_secret):

GET&https%3A%2F%2Fwww.google.com%2Faccounts
%2FOAuthGetAccessToken&oauth_consumer_key%3Dist-server-
v2.isportstracker.com%26oauth_nonce%3D0d530899ac1e5e7bfac28c53ad47311f
%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp
%3D1252311222%26oauth_token%3D4%252F2cOO-CvEPLvEepnuuxDX27L6K7Gy
%26oauth_token_secret%3DqhABWTnXu2pApmPCrQ3BgN%252BC%26oauth_verifier
%3DJAwbWABj2lYNQ0O%252BsBc0S2W%252F%26oauth_version%3D1.0

Parameters and their values are encoded using this function:
  protected function encode_rfc3986($string)
  {
    return str_replace('+', '%2B', str_replace('%7E', '~', rawurlencode
($string)));
  }

I also tried encoding them using str_replace('+', ' ', str_replace
('%7E', '~', rawurlencode($string))) just as in example here:
http://oauth.googlecode.com/svn/code/php/OAuth.php.
It seems that '+' sign in oauth_token or oauth_token_secret or
oauth_verifier results in error.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Picasa Web Albums API" 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/google-picasa-data-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to