Quantcast

Grails OAuth problem - POST method root cause problem identified

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Grails OAuth problem - POST method root cause problem identified

Gregory Pierce
Thanks to all who assisted with getting things moving forward cleanly with with OAuth. With your help I was able to get requests with OAuth moving and collectively a number of bugs were fixed.

That said I've discovered the issue that has been preventing the POST operations from working reliably/at all. Currently the entire system utilized SignPost and HTTPUrlConnection. As described on the SignPost website:


NOTE: When using HttpURLConnection, you cannot sign POST requests that carry query parameters in the message payload (i.e. requests of type application/x-www-form-urlencoded). This is not a limitation of Signpost per se, but with the way URLConnection works. Server communication with URLConnection is based on data streams, which means that whenever you write something to the connection, it will be sent to the server immediately. This data is not buffered, and there is simply no way for Signpost to inspect that data and include it in a signature. Hence, when you have to sign requests which contain parameters in their body, you have to use an HTTP library like Apache Commons HttpComponents and the respective Signpost module. (This restriction does not apply to requests which send binary data such as documents or files, because that data won't become part of the signature anyway.)

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Grails OAuth problem - POST method root cause problem identified

Gregory Pierce
I've fixed this defect in my local repository and will push the fix to github as soon as I figure out git. With this change (which would hilariously become 1.0) it appears that all functions of oauth get/post will be working without any issues. I will also post an example of the get and post request in the update so its cleaner for people to rapidly drop this into their code and use the API.

The downside is that Apache HttpClient is now along for the ride and while its not enormous, its not the tiny plugin it used to be.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Grails OAuth problem - POST method root cause problem identified

acampbell3000
FYI:

Would you mind giving a test and maybe even some feedback regarding the implementation. If it's easier fork the project and GitHub and look at the code there.

Hope all is well.

On 6 September 2010 20:23, Gregory Pierce <[hidden email]> wrote:

I've fixed this defect in my local repository and will push the fix to github
as soon as I figure out git. With this change (which would hilariously
become 1.0) it appears that all functions of oauth get/post will be working
without any issues. I will also post an example of the get and post request
in the update so its cleaner for people to rapidly drop this into their code
and use the API.

The downside is that Apache HttpClient is now along for the ride and while
its not enormous, its not the tiny plugin it used to be.
--
View this message in context: http://grails.1312388.n4.nabble.com/Grails-OAuth-problem-POST-method-root-cause-problem-identified-tp2455602p2528803.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
Kind regards,
Anthony
Loading...