Shinmera / north

An oAuth 1.0a Server & Client, Successor of South
https://shinmera.github.io/north/
zlib License
23 stars 2 forks source link

Request failed issue #1

Closed fengdlm closed 4 years ago

fengdlm commented 4 years ago

Hi,

As a layperson trying to use North, I have trouble to use make-signed-request. The request always fails on me. I am wondering if this is due the order of the header fields. What I see by inspecting the north:request object used in make-signed-request function call, it looks like the following:

     Authorization: OAuth
       oauth_consumer_key="dpf43f3p2l4k3l03",
       oauth_nonce="chapoH",
       oauth_signature="MdpQcU8iPSUjWoN%2FUDMsK2sui9I%3D"
       oauth_signature_method="HMAC-SHA1",
       oauth_timestamp="137131202",
       oauth_token="nnch734d00sl2jdk",
       oauth_version="1.0"

What I read on the rfc5849, it looks like:

     Authorization: OAuth realm="Photos",
        oauth_consumer_key="dpf43f3p2l4k3l03",
        oauth_token="nnch734d00sl2jdk",
        oauth_signature_method="HMAC-SHA1",
        oauth_timestamp="137131202",
        oauth_nonce="chapoH",
        oauth_signature="MdpQcU8iPSUjWoN%2FUDMsK2sui9I%3D"
       oauth_version="1.0"

I am wondering if this is the reason the request failed.

Thanks for you help.

Shinmera commented 4 years ago

According to oAuth 1.0a 9.1.1 parameters must be sorted lexicographically, which is what North does.

Shinmera commented 4 years ago

It is far more likely that you have invalid keys, or that whatever provider you are interacting with is not following the protocol properly.

fengdlm commented 4 years ago

Thanks for the quick response!

The consumer (client) key, consumer (client) secret, OAuth token and token secret are actually preassigned. I am using python with these, and they are working fine. Must be something I did wrong.

Thanks again.