OAuth with Google Reader API using Objective C
Posted
by Dylan
on Stack Overflow
See other posts from Stack Overflow
or by Dylan
Published on 2010-05-24T14:55:08Z
Indexed on
2010/05/24
23:41 UTC
Read the original article
Hit count: 841
I'm using the gdata OAuth controllers to get an OAuth token and then signing my requests as instructed.
[auth authorizeRequest:myNSURLMutableRequest]
It works great for GET requests but POSTs are failing with 401 errors. I knew I wouldn't be able to remain blissfully ignorant of the OAuth magic.
The Google Reader API requires parameters in the POST body. OAuth requires those parameters to be encoded in the signature like they were on the query string. It doesn't appear the gdata library does this. I tried hacking it in the same way it handles the query string but no luck.
This is so difficult to debug as all I get is a 401 from the Google black box and I'm left to guess. I really want to use OAuth so I don't have to collect login credentials from my users but I'm about to scrap it and go with the simpler cookie based authentication that is more mature. It's possible I'm completely wrong about the reason it's failing. This is my best guess.
Any suggestions for getting gdata to work or maybe an alternative iphone friendly OAuth library?
© Stack Overflow or respective owner