'API Gateway sign request with AWS SDK for .NET
I have an API in API Gateway whose Authorization type I have set to AWS_IAM to have API Gateway verify the signature on requests.
And restrict the API endpoint to only specific IAM users.
Now the problem is how can I consume this API from .NET? I cannot create/compute the signature by myself. Does the AWS SDK for .NET offer any helper or utility method/class to have the signature computed which I can attach as the HTTP header to my HTTP request?
Or can the API Gateway SDK for .NET make signed requests to my restricted API Gateway endpoint?
Solution 1:[1]
API Gateway doesn't yet support generated SDKs for .NET, so at this time your options are limited to:
- Find a SigV4 signer library for .NET
- Write your own SigV4 signer based on http://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html
- Try to leverage the existing signing code in the AWS SDK for .NET http://aws.amazon.com/documentation/sdk-for-net/
Solution 2:[2]
I've created a NuGet package called AwsSignatureVersion4 which has been verified to work with the AWS API Gateway. Would love to hear what you think of it!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | RyanG |
| Solution 2 | FantasticFiasco |
