mrjones / oauth

OAuth 1.0 implementation in go (golang).
http://www.mrjon.es
MIT License
269 stars 119 forks source link

The logic behind preventing multiple form parameters with same name. #67

Closed oguzhantopcu closed 5 years ago

oguzhantopcu commented 6 years ago

https://github.com/mrjones/oauth/blob/78d64468d6ec7b74e4b0d47cf61b4f4e288b944b/oauth.go#L835

I am creating an application that makes authorized request to following endpoint. https://www.etsy.com/developers/documentation/reference/listinginventory

The endpoint expects multiple _price_onproperty field as form parameter. The library blocking this usage type. It blocks my project at the same time :). If there is no plausible reason to prevent this better to make pull request to change the behaviour.

mrjones commented 6 years ago

Indeed, you're right!

http://oauth.net/core/1.0a/#anchor13 says:

Parameters are sorted by name, using lexicographical byte value ordering. If two or more parameters share the same name, they are sorted by their value.

So we should support multiple parameters with the same name.

I'm busy with a new baby, and can't promise to implement this right away. I'll try to make some time for it, but, feel free to send a PR if you need it sooner.

ccqpein commented 5 years ago

Hi guys, I am trying to fix this issue today. I give a PR https://github.com/mrjones/oauth/pull/71 . Please check it out.

mrjones commented 5 years ago

Thanks @ccqpein for taking care of this!

I'm going to mark this fixed, please let me know if anyone has trouble.

ccqpein commented 5 years ago

I hope I don't make some bugs inside.

raymond-chia commented 2 years ago

https://github.com/mrjones/oauth/blob/master/oauth.go#L645

If two or more parameters share the same name, they are sorted by their value.

It seems like the parameters are not sorted by values