The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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"
check this URL https://oauth1.wp-api.org/docs/basics/Signing.html : point 2.3 Signing Requests.
You have to create a basestring with the different info you have then create the signature key (consumer secret & token secret) with those 2 "strings" you can generate the HMAC text with online website like https://www.devglan.com/online-tools/hmac-sha256-online
Did you ever get this figured out? I'm facing the same challenge. Thanks!
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!
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
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