1

This question has an answer to how to send request to Amazon SQS service from Apex.

However, I am concerned that we have to expose access and secret keys in the code.
Is this possible to use Named Credentials or other means to store accessKey and secretKey in safe place?

When I try to use Named Credentials for request to Amazon SQS it just doesn't work when I replace endpoint from

req.setEndpoint( 'https://sqs.us-west-1.amazonaws.com/' )

to

req.setEndpoint( 'callout:Test' )

Maybe I have configured invalid Authentication Provider - because I cannot create Named Credentials without it, and Amazon SQS is not in the list of authentication providers. I was trying to use Open ID Connect but I don't really need OAuth here, I just need secure place where I can store and retrieve access and secret keys.

Another problem would be how to access two keys from Named credentials. Even if calling callout:Test worked, how do I get two keys from it to pass to createSigningKey('my-secret-key-here'); method?

I guess I could just use custom object with encrypted fields, but what are the best suggested options? Can we use something else?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.