Hi All,
We are trying to implement connect rest to achieve the below API from Pega 8.5.
Encrypts plaintext of up to 4,096 bytes using a KMS key. You can use a symmetric or asymmetric KMS key with a KeyUsage of ENCRYPT_DECRYPT. | Encrypts plaintext of up to 4,096 bytes using a KMS key. You can use a symmetric or asymmetric KMS key with a...
We are successful in sending data and get the CMK encrypted cipherblob back with PostMan. But postman does sign using AWS Signature Version 4 hence its working.
Has anyone achieved this in Pega without importing AWS SDK. This could be for any AWS hosted REST APIs.
Only alternative that we have is to build custom library/function using AWS SDKs to implement this instead of REST API.
Please share your thoughts. Thanks in advance.
@Murali.Krishnan.D Were you able to find a way to do this? We are looking for a solution to integrate with AWS via REST api as well.
@Murali.Krishnan.D & @ChaithanyaJ9714
We can implement by customizing RULE-CONNECT-REST!INVOKE rule and inserting a step to add AWS V4 signature to header.
I have followed instructions from 2 posts for the java code to create signature
Tutorials and example on Java Programming language(JSP, Servlet, Mysql, Oracle, Database, Blackberry, Android, Swing, Google Maps, Free Java Hosting)
/*
* Copyright 2013-2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.auth;
import com.amazonaws.ReadLimitInfo;
import com.amazonaws.SdkClientException;
import com.amazonaws.SignableRequest;
import com.amazonaws.annotation.SdkTestInternalApi;
This file has been truncated. show original
Make sure to include the 3 headers in Connect REST rule. Pega Engine code will ignore them if you just set them in the java step
I have done a POC with GET operations on S3 APIs and ran without issues.
VenkatM2208
(Venkat Mallepally)
November 9, 2022, 1:57am
4
@GowthamA3261 Have you used code from both posts together? I mean to say you used Java libraries and AWS SDK libraries together to generate signature?
If possible, would you be able to share the java step code? (you can mask the client specific values)
Regards,
Venkat
Shrikanth.N
(Shrikanth Nekkanti)
February 9, 2023, 3:56am
5
@GowthamA3261 We have the similar requirement. Could you please share the code?
@Murali.Krishnan.D Hello Murali, can you please provide the steps to achieve this requirement?
LathaG46
(Latha B G)
July 5, 2024, 5:42am
7
@Gowtham Allu
Could you please share the java code you have used.. we have the similar requirement..
@GowthamA3261 @Murali.Krishnan.D I have similar requirement can you share the steps to be followed.
thanks in advance!
@GowthamA3261 Can you please elaborate more on how this can be achieved. We are also having a similar requirement. However we are stuck at the phase where we generate the AWS signature for authentication.