cl-oauth icon indicating copy to clipboard operation
cl-oauth copied to clipboard

OAuth request token response content type

Open jsmpereira opened this issue 13 years ago • 2 comments

Hello,

I currently need to do (push '("application" . "x-www-form-urlencoded") drakma:text-content-types) in order to obtain a request token.

Since query-string->alist requires a string I was getting stuck when the response body was a vector of octets. https://github.com/skypher/cl-oauth/blob/master/src/core/consumer.lisp#L68

Error and response: http://paste.lisp.org/display/126284

This has only recently came to my attention because I have used cl-oauth previously without issue.

The API I'm authenticating to changed versions recently. I don't know if the response content type changed from the previous version, but it must have because as I mentioned I've been able to authenticate before.

Thanks.

jsmpereira avatar Dec 08 '11 15:12 jsmpereira

José Santos Martins Pereira wrote:

Hello,

I currently need to do (push '("application" . "x-www-form-urlencoded") drakma:text-content-types) in order to obtain a request token.

Would you like to submit a patch?

Leslie

skypher avatar Dec 08 '11 18:12 skypher

I'm not sure if this is an actual issue.

I tried however with the Twitter API and everything worked fine, but their request token endpoint response has content type "text/html" which does not conform with OAuth spec.

My guess would be to check the body content type and if binary, call (flexi-streams:octets-to-string) before passing it to (query-string->alist).

If you believe my reasoning is sane I would be glad to submit a patch.

Regards.

jsmpereira avatar Dec 08 '11 19:12 jsmpereira