Forum Discussion

michaelsh's avatar
michaelsh
Kudo Kingpin
5 years ago

Authorization Header for OAuth 1.0 API

I have a Postman OAuth 1.0 API call which is working great.

I have all the necessary parameters: realm, consumer key, consumer secret, token id, token secret...

I send them in headers with HMAC-SHA256. Works fine in Postman.

I need to construct the same call in Power Query. I notice that Postman automatically creates this header (below).
While I do have the data for the first 4 parameters, but how do I construct the others (in red)?

Thank you!

 

Authorization:
OAuth realm="11111111",
oauth_consumer_key="XXXXXXXXXXXXX",
oauth_token="YYYYYYYYYYY",
oauth_signature_method="HMAC-SHA256",
oauth_timestamp="9999999999",
oauth_nonce="ZZZZZZZZ",
oauth_version="1.0",
oauth_signature="QQQQQQQQQQQ"

5 Replies

  • Having read a bit more, I understand that:
    oauth_nonce can be a random number (maybe encoded?)

    - oauth_timestamp - is just a timestamp
    - which leaves us only with the question - how do I create oauth_signature?

    I understand that it is somehow encoded from all other parameters...

    Maybe someone can please share their Power Query code for this....

    Thanks a lot!

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi michaelsh 

      Could you tell me if your problem has been solved? If it is, kindly share your workround and Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your problem.

       

      Best Regards,

      Rico Zhou

      • michaelsh's avatar
        michaelsh
        Kudo Kingpin

        No, Anonymous , the problem is still there.

         

        For OAuth1.0 authorization I need to create an oauth_signature.

        To do that I need HMAC-SHA1 hash function.

        How do I do it in Power Query, without R/Python?

        Thanks

  • boley2131's avatar
    boley2131
    Frequent Visitor

    Did you ever get this figured out?  I'm facing the same challenge.  Thanks!