Options

need help with oath upload

awaddellawaddell Registered Users Posts: 1 Beginner grinner
I have been trying to get image upload working (use OAuth and 1.3.0), but I can't seem to get the OAuth signature right. I'm using the same routine I use for all my other API call to generate the signature, but it's not working.

I'm not real clear on with OAth "consumer parameter"s to feed into the signature routine. For example "AlbumId" is a obvious parameter, but it's included in the header as "X-Smug-AlbumId". Is it part of the base string used to compute the OAuth signature? I've tried various combinations, but so far have not been able to get it to work.

It would be great if the error message for a failed signature reported the base string computed on the server. I've seen this on other API's and it's very useful for debugging. Don't think this compromises security at all as long as the consumer secret is not revealed.

PUT http://upload.smugmug.com/photo.jpg
Authorization: OAuth oauth_version="1.0", oauth_signature_method="HMAC-SHA1", oauth_signature="+yjUppW+BxiL7Bn8Ov433cvDeWA=", oauth_nonce="-3045406133841064550-1358093430779-6137578772474644112", oauth_signature_method="HMAC-SHA1", oauth_consumer_key="zaak261ZFPf1IHr6XbvSlCzbMwYHFvSx", oauth_token="90960e997420cc15c09dcb8680aaa3a4", oauth_timestamp="1358093430"
X-Smug-AlbumID: 27513686
User-Agent: RockinShare 1.1
X-Smug-Version: 1.3.0
Content-Type: image/jpg
<< image/jpg (40190 bytes) >>


responseCode:200
Edge-Control: no-store
Date: Sun, 13 Jan 2013 16:11:04 GMT
Vary: Accept-Encoding
X-SmugMug-Hiring: How to love what you do: http://www.smugmug.com/jobs/
transfer-encoding: chunked
X-SmugMug-Values: 2/4 - Love your employees
Expires: Sun, 13 Jan 2013 16:11:05 GMT
Content-Type: text/xml; charset=utf-8
Connection: keep-alive
Server: Apache
X-Powered-By: SmugMug/0.9
Cache-Control: private, no-store, no-cache, max-age=1, must-revalidate
Body (parsing 1 ms)
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<rsp stat="fail">
<method>smugmug.images.upload</method>
<err code="35" msg="invalid signature"/>
</rsp>
Sign In or Register to comment.