Goodreads Developers discussion
bugs
>
Missing oauth_verifier parameter on user auth redirect
date
newest »


The step at Appendix A.3 "Request User Authorization" has the service provider returning a set of query params, among them 'oauth_verifier'.
The next step for A.4 "Requesting an Access Token" requires the verifier token in order to successfully retrieve an Access Token. The Goodreads user authentication only supplies the oauth_token parameter after user verification.
That's where I'm blocked. I need an access token in order to find out who a user is (since user auth doesn't give me a reference to the actual user).

Keep in mind that I am successfully retrieving both a request token and authorization of a user. If you'd like me to post those successful requests as well, let me know.

What I can say others have successfully retrieved the access token without using oauth_verifier param. We have some examples of apps here in the forum, many are open source. So you could inspect their code and maybe translate it to JavaScript?

Also, it would be nice if your system could check whether the supplied callback url already includes parameters and if so appends to it, instead of forcing a '?' regardless at the beginning of the parameters you add.
We're getting '?oauth_token' as a parameter instead of just oauth_token

I hit a similar issue to you when I tried to get an oAuth token from Java; maybe my findings will be useful to you.
First, oauth_verifier not being sent back at the authorization callback step. This was surprising to me too. I read the following section from the oAuth Bible:
http://oauthbible.com/#oauth-10a-thre...
To quote:
"On Step 6 if the oauth_verifier has not been set, this is a failed OAuth 1.0a 3-Legged implementation and probably only requires the oauth_token to be sent. Rarely seen but they exist."
So, I removed any reference to setting verifier in my code; still didn't work. The piece which made it work for me was setting the *temporary token*'s secret as the token shared secret when signing the access token request. Maybe this would also work for you?
Here is a repo I created with a working sample (Java) in case it helps:
https://github.com/davecahill/goodrea...
Thanks,
Dave.


Below is the method, API endpoint, the Authorization header, and the POST body. As a sidenote, I've also tried this as plain HTTP with PLAINTEXT encoding, which did not work either. Also, if I don't send a POST body, but instead make those token params part of the Authentication data, I get a very vague 'Invalid OAuth Request' error. The request below is what results in a 500:
POST https://www.goodreads.com/oauth/acces...
Authorization: OAuth oauth_consumer_key="xxxx", oauth_nonce="xxxx", oauth_signature="xxxx", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1413406916", oauth_version="1.0"
oauth_token=xxxx&oauth_token_secret=xxxx
I am obtaining the oauth_token and oauth_token_secret values correctly via /request_token (which is the values above). It just seems like the /access_token endpoint is the bad one.
My first thought is that the /oauth/authorize redirect doesn't include an 'oauth_verifier' parameter, which is something that I believe is required...if not, then is there any idea as to why I'm getting a 500?