I am having an Architecture where I am using API Gateway with Cognito User Pool Authorizer and I am passing the IdToken in Authorization Header from client side ReST call.
It is working fine.
I need the cognitoIdentityId in Lambda.
Tried Body Template Mapping in Integration Request in API Gateway
Content type - application/json
{
"cognito-identity" : "$context.identity.cognitoIdentityId"
}
It doesn't send the identityid (in event or in context) and also it transforms my payload only to this json.
How to get the identityid in Lambda in this scenario with my payload intact?