AWS V4 signature does not match when special characters in the query parameter for req via APIgee.

How do we  handle special characters of the query parameters  for eg 

$.relatedParty[?(@.name=="acr")].id=214006STATRSV2023-04-07T10:05:37ZhlEa2DwiIjqjKlcmmimZnG4VOsE8ZFsbe3H0W3QyJbHg8Q9pHjaSPDMh2PjQWYGcI21g2

Error Message

{"message":"The request signature we calculated does not match the signature you provided.......

It works fine when there is no special characters in the query parameters. 

Tried doing  encodeURIComponent  but it yet does not match the signature created by AWS. Noticed that apigee  encode's differently the characters eg "(", "+" etc.

Could you please suggest how this could be resolved. It is a blocker for the project.

 

0 1 182
1 REPLY 1

Just seeing this now.  Are you still blocked on this issue? The Java callout calls encodeURIComponent() on the individual query params before calculating the signature. I think this is as specified by AWS.  If you could provide a test case showing a valid signature, and the message with "special characters" in the query params, I can take a look at it.