- Le plus récent
- Le plus de votes
- La plupart des commentaires
Hello,
Thank you for posting on AWS re:Post!
I understood that you have added post authentication lambda trigger to your userpool but when you have tried testing by logging in to Cognito, it didn't got invoked.
Firstly, I would like to provide you below AWS reference document for understanding the important consideration while using lambda trigger with Cognito.
You have mentioned that post authentication lambda trigger didn't got invoked after authentication. In order for Cognito to invoke lambda function, you need to associated following resource based policy to your lambda function.
{
"Version": "2012-10-17",
"Id": "default",
"Statement": [
{
"Sid": "lambda-allow-cognito",
"Effect": "Allow",
"Principal": {
"Service": "cognito-idp.amazonaws.com"
},
"Action": "lambda:InvokeFunction",
"Resource": "<your Lambda function ARN>",
"Condition": {
"StringEquals": {
"AWS:SourceAccount": "<your account number>"
},
"ArnLike": {
"AWS:SourceArn": "<your user pool ARN>"
}
}
}
]
}
Please attach this resource based policy to your lambda function to allow Cognito userpool to invoke the function.
I hope this information will be helpful to you.
Thank you!!
Contenus pertinents
- demandé il y a un an
- demandé il y a 7 mois
- demandé il y a un an
- demandé il y a 7 mois
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a un an