Postman supports AWS authentication when making http calls via the auth tab. Is there anyway to access this authentication method via pm.sendRequest?
I have found references to being able to use basic and digest authentication via pm.sendRequest by declaring an ‘auth’ parameter in the options object. Something similar to the following:
I have found a similar question posted in 2020, however the following post from 2023 makes me think that the AWS Signature support might have been added to postman later than that question and I am hoping that it has also been exposed to the sendRequest method.
Assuming that pm.sendRequest does now support AWS, what are the runes required to access it. I am expecting something like the following but I keep getting ‘handler not found’ errors.
Hi Mike, and thank you. The headers that have to be generated are hmac encodings of some secrets and the http request itself after some preprocessing to make the encoding repeatable. Information on the AWS encoding is well documented here. It is not straight forward to replicate in the postman environment and I would prefer to use the AWS Signature support within postman, if it has been exposed to sendRequest. I am hoping that it has. If not then it would be great if it was.
You wouldn’t be able to achieve this with pm.sendRequest(), as Mike mentioned, the auth helpers are doing a whole bunch of things in the background to make this easier.
Some auth methods can be created with pm.sendRequest() but I don’t believe that this would be one of those.
You superstar Mike, that reference to the code was exactly the lead that I needed. From there I was able to find the registration of the security handlers within postman and I found that pm.sendRequest is wired up there. The following are the runes that I needed and I share incase anybody else ever requires them: