-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Calculating oauth signature using OAuthSignatureCalculator intermittently fails in Netty's validateHeaderValue method #1415
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
Comments
Thanks! Could you compare with the token generated by another OAuth1 implementation? |
Do you have a suggestion which other OAuth implementation I can try and compare this with? |
I guess signpost is the reference in Java: https://github.com/mttkay/signpost |
OK, I've tried to verify this with signpost and I don't get the exception there, because it encodes the characters differently. In signpost the auth header looks something like
AHC generates a header like
We're still talking randomly generated strings of course. |
A further investigation in the keyValue / tokenValue in my testcase reveals that the \u000c in the keyValue is causing the problem here. If I remove this character, the exception does not occur. It does not matter if I add tho \u000c to the tokenValue. |
@fbascheper I think I've pinned it. Could you please give the fix a try? |
LGTM, I've run several thousand tests with the original code (I already worked around it in the dispatch code by using only alphanumeric characters instead of arbitrary strings) and I didn't get any more test failures using a local 2.0.33-snapshot build. |
Thanks for your feedback! |
We're currently trying to upgrade Dispatch / reboot to the latest AsyncHttpClient 2.0.x version. I've created dispatch/reboot#149 for this. But now one of our tests intermittently fails in OAuthSignatureCalculator from an exception originally thrown by Netty.
We are using scalacheck Properties to generate random values for both the key and token, which are subsequently fed into the OAuthSignatureCalculator, which randomly crashes with AHC 2.0.32 (and the latest 2.1 alpha as well).
I've extracted a test failure on our side and created a test that you can add to
org.asynchttpclient.oauth.OAuthSignatureCalculatorTest
so you can reproduce our error.This test fails in IntelliJ with the following exception:
The text was updated successfully, but these errors were encountered: