I need to call an AWS Gateway API service that is secured with AWS_IAM.
I want to use HttpClient as this is the recommended way by Microsoft.
I have found some example code using other ways. I've also found the official AWS SDK that uses their internal IRequest. I'm currently writing an implementation of IRequest so I can use Amazon.Runtime.Internal.Auth.AWS4Signer.SignRequest. But this seems incredibly hacky!
What I really want is something that will take my HttpClient, then inject the Host, X-Amz-Content-SHA256, X-Amz-Date and Authorization headers.
I find it hard to believe there is not a ready-to-use library already existing.
Note that this is similar to this question, but it is a bit old and I would have hoped there would be an easier way now. Is there a .NET library that can sign a request with AWS V4 Signature?
Update 2018-03-21 - there is now a NuGet package https://www.nuget.org/packages/Aws4RequestSigner/
My colleague has used this and reports it to work well! I hope this is of help to anyone arriving at this question.