GenericApiGatewayClient for Http DELETE method gives unmatched signature exception
Hi Ryan,
First of all: Great job! I have successfully used this library for Http(s) GET, PUT and POST invocations on my AWS API Gateway API entry, secured by AWS IAM. Again, thank you for your work! My question is as follows: when I try to use it for a Http DELETE invocation, I get:
ca.ryangreen.apigateway.generic.GenericApiGatewayException: {"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details."} (Service: execute-api; Status Code: 403; Error Code: InvalidSignatureException; Request ID: xx0000xx-x000-00x0-etc.)
Do you know what's causing this? Just like the PUT and POST calls, I'm using a request in the DELETE as well.
Best regards,
Charles Vuijst
Hi Ryan, Meanwhile I did some additional searching and found at: http://docs.aws.amazon.com/apigateway/api-reference/signing-requests/ the following:
The canonical request must include the host and x-amz-date headers for requests without a payload, such as GET or DELETE and must also include the content-type header for requests requiring a payload, such as PATCH, POST or PUT.
So instead I tried a DELETE execution without an Http request body and put an identifier on the path variable instead for the deletion in the API. That works with your library as well! So this looks like the solution, but could be considered a work around:DELETE calls from Postman with an AWS signing signature and a request body seem to work. Anyhow, still happy to use your work, Best regards,
Charles
Since DELETE with Payload works in Postman, it shows AWS Gateway supports it.
Would AWS update the AWS SDK to make DELETE with payload work?
To be clear, this is not the AWS SDK, but a 3rd-party library for API Gateway maintained by the community.
Most use cases for DELETE use a parameter instead of a payload so I would consider this somewhat of an edge case. That said, PRs would be welcome.
On Fri, Jun 21, 2019 at 9:35 PM cherryngai [email protected] wrote:
Since DELETE with Payload works in Postman, it shows AWS Gateway supports it.
Would AWS update the AWS SDK to make DELETE with payload work?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rpgreen/apigateway-generic-java-sdk/issues/5?email_source=notifications&email_token=AAKQYVEARTCU3CX7KJVPV4DP3VUFXA5CNFSM4EFHE3W2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYJ3JVQ#issuecomment-504607958, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKQYVCJOVHTTJWF6A3M7C3P3VUFXANCNFSM4EFHE3WQ .
Thanks @rpgreen . I have created https://forums.aws.amazon.com/thread.jspa?threadID=305306.
My usecase requires a payload on DELETE.
If someone can help, it is appreciated.