I’m trying to work out how I can use the authorisation header in a Lambda event object to get the user details. I’m using the @aws-sdk/client-cognito-identity package, but it isn’t clear how to do this in fron the documentation.
You can use the AWS SDK for JavaScript to get a Cognito user from the Lambda authorization event header. First, you need to import the AWS > SDK into your Lambda function. Then, you can use the getCognitoIdentity() method to get the Cognito user from the event header. The
getCognitoIdentity() method takes the event object as an argument and returns an object containing the Cognito identity ID and the pool ID.