mike1
#1
I’m doing the following. 1-3 works but 4 fails with “Could not authenticate you”
-
Generate request token using /oauth/request_token
-
Forward user to /oauth/authenticate?oauth_token=(oauth_token obtained from 1)
-
Obtain user oauth_token and oauth_token_secret from oauth/access_token?oauth_token=x&oauth_verifier=y where x and y were received in the callback from 2
-
Attempt to get user data from /1.1/users/show.json?userid=x&oauth_token=user_token, where user id and oauth token were obtained in 3
4 fails with 32: Could not authenticate you
I’m positive I’ve correctly implemented the signing method since it works correctly in 1 and 3. I’m using as the signing key consumer_secret_key&oauth_token_secret as was obtained in 3.
I’m also almost positive I’ve generated the correct oauth base string for signing. I’ve spent a few hours meticulously checking and rechecking it and it seems correct.
It makes me thing that either 1) My app is not allowed to collect user data yet or 2) There is an additional step in my workflow that’s missing before attempting to read a user profile
Does anyone have any feedback on this? Help appreciated
OAuth tokens aren’t passed as API parameters, they’re part of the headers (take a look at the Example Request for users/show to see what I mean)
2 Likes
mike1
#3
I was confused about where to pass oauth token, since in oauth/access token it was passed as a url parameter.
Also my issue was that in the base string for signing the base url excluding the query string was required.
ex
GET&…/1.1/users/show.json&…
NOT
GET&…/1.1/users/show.json?user_id=…&…
There appears to be an inconsistency in the twitter API behavior because for the REST call oauth/access token accepts the signature when the URL part includes the parameters, which led me to believe it was required this way.
But it works for me now nonetheless.
Thank you for the response.
2 Likes
system
closed
#4
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.