We have a JWT Payload like this:
{
"sub": "example.com",
"aud": "Example Site",
"iss": "https://example123.com",
"exp": 1610468532,
"iat": 1610466732
}
We have a response.mainpart that holds the promoter id,
20210112 15:52:17.180 INFO -4 Response mainpart :{ "promoterId": "testPromoterId", "aud": "Example Site" }
How do we insert the promoterId element into payload message?
{
"sub": "example.com",
"aud": "Example Site",
"iss": "https://example123.com",
"exp": 1610468532,
"iat": 1610466732,
"promoterId": "testPromoterId"
}
API Gateway: 9.3
One approach would be to use RegEx to remove the curly brackets and appends the variable to the payload. Attached is a sample policy.
NOTE: This is not intended to be a final solution. It is intended to be a guide towards a working solution.