How to send Outbound REST Messages using AWS Signature Version 4?

spinol
Kilo Explorer

Currently trying to send outbound REST messages using AWS sigv4 authentication. I have everything working in POSTMan but when I try to implement the same headers within ServiceNow, I end up with 502 errors. Can anyone assist?

Thanks!

13 REPLIES 13

josh_nerius
ServiceNow Employee
ServiceNow Employee

Hello, 

Check out this item on Share: Amazon Signature V4 AWS Client POC

This is a proof of concept for calling the SQS API, but it can be easily adapted to call other Amazon APIs as well. The primary part of the solution was pulling in the open source 'aws4' library and using it as a Script Include. 

The SQSClient script include shows how to use this with ServiceNow's RESTMessageV2 API. 

Best,

Josh

Hello,

 

Thank you for this information. I have tried to implement this on my instance but I have not had any luck. Have you been able to implement this share on your instance without any issues?

 

Thanks!

josh_nerius
ServiceNow Employee
ServiceNow Employee

Yes, I wrote it 🙂 What sort of issues are you running into? 

Well I didn't notice that part. But that's awesome! This is the error that I am receiving when running the API call:

 

{"Error":{"Code":"SignatureDoesNotMatch","Message":"Credential should be scoped to correct service: 'sqs'. ","Type":"Sender"}

Is there a separate set of creds that I need for my SQS queue?

Thanks!