I'm trying to use Cognito Post authentication trigger to attach an AWS IoT Policy to my users and for that I need the Cognito identityID. However, when triggering the Post authentication lambda I only receive basic informations about the user:
{
version: '1',
region: 'eu-west-1',
userPoolId: 'eu-west-1_xxxx',
userName: '6411221azf-7af6-44b7-a0fb-8e52f213bcc4',
callerContext: {
awsSdkVersion: 'aws-sdk-unknown-unknown',
clientId: 'u88vwwf7no8vijkt81ocg704e4cl'
},
triggerSource: 'PostAuthentication_Authentication',
request: {
userAttributes: {
sub: '6411221aesge-dgrg56-DRGD43-8e52f213bcc4',
email_verified: 'true',
'cognito:user_status': 'CONFIRMED',
'cognito:email_alias': 'wwwwwwww@gmail.com',
phone_number_verified: 'false',
phone_number: '+00000000',
email: 'xxxxx@gmail.com'
},
newDeviceUsed: false
},
response: {}
}
Is there any way for me to get the cognito identityID when triggering the lambda ? Thanks!!