Goodreads Developers discussion

21 views
questions > Help debugging oauth issues

Comments Showing 1-3 of 3 (3 new)    post a comment »
dateUp arrow    newest »

message 1: by Gavin (new)

Gavin Henderson | 2 comments Im struggling to successfully make an oauth request using node and the node-oauth library.

Whenever I make a request to /api/auth_user I get an invalid oauth error. Is there a way to debug this and get more useful error messages? Right now i am at a bit of a loss. Any help would be appreciated

I have verified that my signature is correct and besides that Im not sure what else is to check.

Here is the options I am sending

{
port: 443,
hostname: 'www.goodreads.com',
method: 'GET',
path: '/api/auth_user',
headers: {
Authorization: 'OAuth oauth_consumer_key="***********",oauth_nonce="ScC0fuPhkARaZK1Bv8Oj33taSb7PZwy3",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1600964115",oauth_token="**************",oauth_version="1.0",oauth_signature="bD8CUV0j%2BhEuLGrqT%2BHYdAnZizQ%3D"',
Host: 'www.goodreads.com',
Accept: '*/*',
Connection: 'close',
'User-Agent': 'Node authentication',
'Content-length': 0,
'Content-Type': 'application/x-www-form-urlencoded'
}
}


message 2: by Alex (new)

Alex | 4 comments What does the response look like? Are you sending the options as headers or as query parameters?


message 3: by Gavin (new)

Gavin Henderson | 2 comments Alex wrote: "What does the response look like? Are you sending the options as headers or as query parameters?"

The response is a 401 with the message `Invalid OAuth Request` followed by a random length comment.

Interestingly, when I run the exact same code but give it the url `"https://www.goodreads.com/friend/requ..."` instead of "https://www.goodreads.com/api/auth_user" I get results

The headers are specifically this part:
{
Authorization: 'OAuth
oauth_consumer_key="***********",oauth_nonce="ScC0fuPhkARaZK1Bv8Oj33taSb7PZwy3",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1600964115",oauth_token="**************",oauth_version="1.0",oauth_signature="bD8CUV0j%2BhEuLGrqT%2BHYdAnZizQ%3D"',
Host: 'www.goodreads.com',
Accept: '*/*',
Connection: 'close',
'User-Agent': 'Node authentication',
'Content-length': 0,
'Content-Type': 'application/x-www-form-urlencoded'
}


back to top