Paw rest client: how to compute HMAC-SHA256 using an absolute URL as input

I use the amazing Paw software to create Htpp requests. It has many great features, including the ability to calculate HMAC-SHA256 signatures; unfortunately, I cannot find how to use the full URL of the current request as input. What is the key to enter in the input field?

+4
source share
1 answer

Step 1

  • Right click on the field where you want to insert the hash, select Crypto> HMAC-SHA256
  • In the "Enter" field, right-click and select "Request"> "Request URL"

Step 2

  • Now you should see the dynamic value of the request URL in the input field, this means that the dynamic value of HMAC-SHA256 will accept the current URL of the request as its input for calculating hashes
  • Enter the HMAC key in the Key field (tip: right-click and select Values> Protected Value so your key is encrypted = more secure!)

Compute the hash of a request URL in Paw


Old version / original answer (not updated):

There is no (yet) dynamic value that returns a URL that is missing. But here is a workaround:

In the Login field of the HMAC-SHA256, right-click and select Extensions> Custom. You will have a JavaScript text field to return the function:

return context.getCurrentRequest().url; 

Compute the Request URL Hash in Paw

See the Extensions Reference for more details.

+7
source

All Articles