insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

“Generate code” for request with AWS IAM v4 not having Authorization Header

Open cloud-j-luna opened this issue 2 years ago • 3 comments

Expected Behavior

When I click “Generate Code” in a request with authentication set to AWS IAM v4 (with all values set and working if I send the request through Insomnia) I expected to see a Authorization Header in the generated code.

Actual Behavior

No header is there and so the request fails as unauthorised. Generated code is simply curl —request GET —url <the url I’m requesting>

Reproduction Steps

Create a request that uses AWS IAM v4 and click Generate Code.

Is there an existing issue for this?

Additional Information

No response

Insomnia Version

2022.4.2

What operating system are you using?

Ubuntu

Operating System Version

20.04

Installation method

Ubuntu Software Store

Last Known Working Insomnia version

No response

cloud-j-luna avatar Jun 23 '22 13:06 cloud-j-luna

Hi @joao-luna-98 thank you for reporting this!

We're able to reproduce it as well: image

image

Doesn't seem to be happening for other authorization methods we have, e.g. bearer or basic: image

@dimitropoulos any idea if this could be an issue on https://github.com/Kong/httpsnippet?

EDIT/UPDATE: we've been investigating some more and seems that it is happening even before the conversion when we call httpsnippet. If we try to export the request as HAR, it is missing the Auth header. Other authentication methods when exported to HAR, work and show the Auth header.

Seems we don't get the AWS auth header, because it was never added to the getAuthHeader method

filfreire avatar Jun 29 '22 13:06 filfreire

Could there be an option to either show it as an Authorization header or as a --aws-sigv4 which was added on version 7.75 of curl (more details in the manpage).

cloud-j-luna avatar Jun 29 '22 21:06 cloud-j-luna

Auth details are missing in some other scenarios. I don't see them when using Microsoft NTLM auth with PHP Curl, data should include

CURLOPT_HTTPAUTH => CURLAUTH_NTLM, CURLOPT_USERPWD => $username . ":" . $password,

marko-stimac avatar Sep 12 '22 12:09 marko-stimac