Skip to content
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

callback uri getting double encoded? #22

Closed
alanhartless opened this issue Sep 27, 2014 · 2 comments
Closed

callback uri getting double encoded? #22

alanhartless opened this issue Sep 27, 2014 · 2 comments

Comments

@alanhartless
Copy link

I'm not for sure which library is at fault as I'm not sure what the specification is :-)

I'm trying to use the PHP version as a client and https://github.com/willdurand/BazingaOAuthServerBundle as the server. The problem I'm running into is the server is rejecting the client's call to request token because of an invalid signature. What I found is that this library is double encoding oauth_callback when included as a parameter.

So what the server expects as http%3A%2F%2F, it is receiving http%253A%252F%252F

In the php version, it is encoding the parameters in _normalizedParameters() then again when generating the sbs in _generateSignature(). The server creates the normalizedParameters without encoding then encodes the entire base string so that parameters are not double encoded.

Which is in the wrong? :-)

Thanks!
Alan

@alanhartless
Copy link
Author

Just as a FYI, I fixed to be compatible with the server by remove the _oauthEscape calls in _normalizedParameters() so that it's only encoded once via _generateSignature().

@jrconlin
Copy link
Owner

Huh, weird. I'm surprised that more end points haven't complained about that. It could well be that there are more than a few broken OAuth server libs out there, too.

Parameters should be normalized just once, so there's definitely a bug, thanks! If you want to submit a PR, go ahead, or I'll just update the various versions.

jrconlin added a commit that referenced this issue Sep 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants