-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't use params in a get() with OAuth creds #722
Comments
It looks like https://github.com/kennethreitz/requests/pull/712 was only for URLs with fragments, which doesn't match your case. I haven't had much of a chance to look at it again since you commented on https://github.com/kennethreitz/requests/pull/684 except to verify that I was testing with LinkedIn, which apparently verifies the signature differently, so it wasn't erroring out. I took that as confirmation that this was no longer an issue, without testing it with other providers, such as your case with Twitter. I'm starting to wonder if there might be a bug in oauthlib, which provides the signature functionality. I'll have to do some more digging to determine if that's the case. |
@gulopine Ah, thanks! I couldn't find my comment in 684! Haha, I was looking for it. And what does Linkedin use? Query or body? |
I guess I have to look at it some more. I've looked at so many providers for foauth.org that I think I'm getting really confused. I know I have Dropbox working with params, and that may be what I'm thinking of, not LinkedIn. Dropbox and Twitter both use the Authorization header for the signature payload, but Dropbox uses the plaintext approach, which doesn't take parameters into account at all. So it's not surprising to me now that it would behave very differently from Twitter. |
Oh, I didn't know you were behind foauth. Haha. Nice service. Mike Helmick On Friday, July 13, 2012 at 1:14 PM, Marty Alchin wrote:
|
So I figured out what's going on here, but I'm not sure yet how to best fix it. The fix I put in for https://github.com/kennethreitz/requests/pull/684 does help it generate the correct signature, but then requests rewrites the URL based on the result from oauthlib, in case it added OAuth parameters to the QueryString. Unfortunately, it rewrites the base URL, which then has all the parameters added to it later, before firing it off to the provider. So in a nutshell, here's the URL that requests is actually sending Twitter, in this case:
Notice how The trouble is, we need it to rewrite the URL in case OAuth parameters get added to it, but we can't let it add non-OAuth parameters to it, because requests will add those later. So it seems like there are a couple options:
I like the second option the best overall, because it seems more useful in the long run, in case something else like this happens elsewhere. But it might be more practical to go with the first option since it probably won't come up anywhere else anyway. I'll sleep on it and see what tomorrow brings. |
I agree, second does sound best, but the first is more practical.. but for some reason I feel like it's #3 I just woke up, so let me think about this to. |
After trying out a few alternatives, I talked with @kennethreitz briefly about this on IRC, and he came up with the obvious solution: I think I screwed up my fork, so I don't know if I can submit a proper pull request, much less attach it to this ticket. That commit should illustrate the point, though. |
So, seeing that the params being handled was fixed https://github.com/kennethreitz/requests/pull/712
I tried to update
Twython
to userequests
0.13.3Params are still not being handled correctly with OAuth.
But this works fine:
The text was updated successfully, but these errors were encountered: