request / oauth-sign

OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RFC5849 example failed.

hyjin opened this issue · comments

Fails on an example in OAuth 1.0 specification(RFC5849).
It caused by following two:

Handling multiple parameter values with same key.

When node's querystring parse query string and build object, it builds value as an array for same keys. For instance:

> var qs = require('querystring')
> var str = 'a=1&a=2&a=&b=3'
> qs.parse(str)
{ a: [ '1', '2', '' ],
  b: '3' }

Currently, oauth-sign does not handle array value.

Sorting in parameter normalization

The specification requires percent encode before sorting parameters. (http://tools.ietf.org/html/rfc5849#section-3.4.1.3.2)
In some case, the sort order may differ after encode. (e.g. c2 < c@, but c2 > c%40)

And also it requires to sort by value when there is a same keys, but current oauth-sign does not sort by value.

your oauth-sign PR was merged and released as v0.4.0, could you update this pull request to include the required version of oauth-sign.

Resolved by #6 .