insomnia
insomnia copied to clipboard
“Generate code” for request with AWS IAM v4 not having Authorization Header
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?
- [X] I have searched the issue tracker for this problem.
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
Hi @joao-luna-98 thank you for reporting this!
We're able to reproduce it as well:
Doesn't seem to be happening for other authorization methods we have, e.g. bearer or basic:
@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
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).
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,