Invalid OAuth token error on POST

31 views
Skip to first unread message

Chris Smith

unread,
Aug 7, 2010, 11:51:14 PM8/7/10
to Powershop Developers, devel...@powershop.co.nz
Hey Guys,

I'm developing a basic Android app for interfacing with powershop
(similar functionality to the iPhone app) and I'm having some trouble
when trying to POST a meter reading...

Firstly, I'm using the Android standard library + Signpost OAuth
Library (http://code.google.com/p/oauth-signpost/). You can find some
example code of what I'm doing here: http://gist.github.com/513554

Using this library and method works great when doing GET's -
everything is authenticated and returned correctly. By default the
signpost library puts the OAuth information in the "Authorization:"
header.

However, when I try and post a set of meter readings I will always get
"[E903] Invalid OAuth token".

I've tried the following:
- Putting the OAuth information in the "Authorization" header, as per
the GET request
- Putting the OAuth information in the URL query parameters
- Sending the icp/reading information as part of form/post data
- Sending the icp/reading information in the url query parameters
- Not signing the request at all (I get "[E901] invalid oauth
signature method")

I've also gone as far as setting up a stub on my own server to post
the same request to and verify that all the data is there and well-
formed. As far as I can tell, it is.

So, can anybody give me a hint at what might be wrong, some other
things to try? Am I POSTing the data correctly? Or am I looking at a
Signpost bug and I should take it up with them?

Cheers,
Chris.

shavenyaknz

unread,
Oct 3, 2010, 10:18:22 PM10/3/10
to Powershop Developers
You got further than I did. I downloaded the OAuthForTwitter sample
which also uses signpost but I can't even get it to authenticate.

Chris Smith

unread,
Oct 3, 2010, 10:37:57 PM10/3/10
to shavenyaknz, Powershop Developers
Bad luck :\ I noticed that I could never get their examples working without fiddling, either.

For the record, the bug I was running into was in Signpost and is detailed here:


I'm running a patched .jar until he releases a new point release. So I'm working on the application again!

Cheers,
Chris

--
You received this message because you are subscribed to the Google Groups "Powershop Developers" group.
To post to this group, send email to powershop-...@googlegroups.com.
To unsubscribe from this group, send email to powershop-develo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/powershop-developers?hl=en.


Reply all
Reply to author
Forward
0 new messages