爪足客户端:如何使用绝对URL作为输入来计算HMAC-SHA256 [英] Paw rest client : how to compute HMAC-SHA256 using absolute url as input

查看:112
本文介绍了爪足客户端:如何使用绝对URL作为输入来计算HMAC-SHA256的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用很棒的Paw软件发出Htpp请求.它具有很多出色的功能,包括能够计算HMAC-SHA256签名的功能,不幸的是,我找不到如何使用当前请求的完整url作为此请求的输入.在输入字段中输入的主要内容是什么?

I'm using the awesome Paw software to make Htpp requests. It has a lot of great features including the ability to compute HMAC-SHA256 signatures, unfortunately, I cannot find how to use the full url of the current request as input of this. What is the keywork to enter in the input field?

推荐答案

步骤1

  • 右键单击要在其中插入哈希的字段,选择加密">"HMAC-SHA256"
  • 输入字段中,右键单击并选择Request> Request URL
  • Right-click on the field you want to insert the hash into, pick Crypto > HMAC-SHA256
  • In the Input field, right-click and pick Request > Request URL

第2步

  • 您现在应该在输入字段中看到一个 Request URL 动态值,这意味着HMAC-SHA256动态值将采用当前请求的URL作为其哈希计算的输入
  • 在密钥"字段中输入您的HMAC密钥(提示:右键单击并选择值">安全值",以使您的密钥保持加密=更安全!)
  • You should now see a Request URL dynamic value in the input field, this means the HMAC-SHA256 dynamic value will take the current request's URL as its input for hash computation
  • Enter your HMAC key in the Key field (tip: right-click and pick Values > Secure Value to keep your key encrypted = safer!)

旧版本/原始答案(不是最新版本):

(还)没有动态值返回URL,这是一件丢失的事情.但这是一种解决方法:

There is not (yet) a Dynamic Value that returns the URL, that's a missing thing. But here's a workaround:

在HMAC-SHA256的输入"字段中,右键单击并选择扩展名">自定义". 您将有一个JavaScript文本字段,使函数返回:

In the HMAC-SHA256 "Input" field, right-click and choose "Extensions" > "Custom". You'll have a JavaScript text field, make the function return:

return context.getCurrentRequest().url;

有关详细信息,请参见扩展参考.

See the Extensions Reference for more details.

这篇关于爪足客户端:如何使用绝对URL作为输入来计算HMAC-SHA256的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆