Do the OAuth classes use params in POST body to sign header?

112 views
Skip to first unread message

Dylan

unread,
May 24, 2010, 10:07:33 AM5/24/10
to Google Data APIs Objective-C Client Library Discussion
I'm trying to use this package for communication with the Google
Reader API. It was simple and worked well for GET requests but all of
my POSTs to the API fail with a 401 response. The GReader API requires
parameters in the POST body and it doesn't look like the classes in
this package encode these into the signature. I tried hacking in
support at the same point the URL request params are parsed but it
didn't change the result from the GReader API.

Any ideas? Am I barking up the right tree?

--
You received this message because you are subscribed to the Google Groups "Google Data APIs Objective-C Client Library Discussion" group.
To post to this group, send email to gdata-objec...@googlegroups.com.
To unsubscribe from this group, send email to gdata-objectivec-...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gdata-objectivec-client?hl=en.

Greg Robbins

unread,
May 24, 2010, 5:21:02 PM5/24/10
to gdata-objec...@googlegroups.com
I've checked in support for signing the POST body parameters when the content type of the request is "application/x-www-form-urlencoded".

http://code.google.com/p/gdata-objectivec-client/source/detail?r=536

Since none of the supported Google APIs put parameters in the post body, this is rather experimental. Please let me know if you have further trouble.

Dylan

unread,
May 24, 2010, 5:35:40 PM5/24/10
to Google Data APIs Objective-C Client Library Discussion
That was quick, thanks.

I can't try this until later but I'm curious about one of the changes.
Functionally, what you checked in looks the same as what I tried to
put together but with one difference. You changed the sorting of
parameters to be case sensitive. One of the parameter names for the
GReader API is "T". Was this a change to handle that?

I'll let you know how it works.

Greg Robbins

unread,
May 24, 2010, 5:48:13 PM5/24/10
to gdata-objec...@googlegroups.com
The sorting change might affect that, though the change wasn't due to the Reader API in particular (I've not tested OAuth with the Reader API.)

Dylan

unread,
May 24, 2010, 7:24:30 PM5/24/10
to Google Data APIs Objective-C Client Library Discussion
So, yeah, the case sensitivity was key in addition to signing the POST
body params. It's working now. Thanks.

Greg Robbins

unread,
May 24, 2010, 7:36:01 PM5/24/10
to gdata-objec...@googlegroups.com
Good to hear. OAuth is a challenging protocol.

kai

unread,
Jun 3, 2010, 2:52:55 PM6/3/10
to Google Data APIs Objective-C Client Library Discussion
Would it be possible to adapt the oauthsampletouch project to work
with the Latitude API? Specifically, could I manually construct the
json post (since there aren't native object-based methods) to get/post
to Latitude? Any thoughts on if/when there will be a oAuth/Latitude
sample project? THANKS -

Greg Robbins

unread,
Jun 4, 2010, 3:11:34 PM6/4/10
to gdata-objec...@googlegroups.com
You can use the OAuth sign-in controllers to authenticate for Latitude. Since that is unrelated to the previous question in this thread, please ask with a different email subject line if you'd like to see sample code for authenticating to Latitude. Full Objective-C library support for the new JSON-based APIs (Latitude, Buzz, Moderator) is being worked on but won't be ready for several months. The new APIs are also still "in labs" and are fairly experimental and likely to change.
Reply all
Reply to author
Forward
0 new messages