So I am trying to set up a custom authorizer in API Gateway.
I can get it to forward a request with a valid token to the lambda function specified in the API method. I cannot figure out how to access the principalId passed on by my authorizer though.
When executing the request I get the following in the Cloud watch log:
Authorizer result body before parsing:
{
"principalId": "16",
"policyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Condition": {},
"Action": "execute-api:Invoke",
"Resource": [
"arn:aws:execute-api:eu-central-1:****:***/null/*/*"
],
"Effect": "Allow"
},
{
"Condition": {},
"Action": "execute-api:Invoke",
"Resource": [],
"Effect": "Deny"
}
]
}
}
So how do I access the principalId in my lambda function? Is the object even passed on to lambda? And if it is not, how do I get at least the principalId to passed?