3

I am trying to get the Cognito username from within my lambda function. I have enabled my api gateway to use "Use Lambda Proxy integration". It is now returning the identity object but cognitoIdentityId is returning null?!?

Is there something I am missing?

UPDATE As usual, I missed something vital! On that POST API, I did not select the Authorization user pool. DUH!

SumoTech
  • 83
  • 2
  • 9

1 Answers1

0

using event['requestContext']['authorizer'].claims.sub worked for me.
I also had to send the jwt id token as Authorization Header for the API call.