Questions tagged [amazon-cognito-triggers]

Use this to group Amazon Cognito-based sub-queries related to Lambda triggers.

79 questions
2
votes
1 answer

Aws cognito user migration where MFA is required

I want to migrate the cognito users to new user pool where MFA is required and old pool also has the MFA required. I have created the lambda trigger which is getting trigger and returning the required response as follows: "response": { …
2
votes
1 answer

Java-based AWS Cognito Pre-Sign-up Lambda Trigger: Automatically confirm user and validate email

I am developing a Java-based AWS Cognito Pre-Sign-up Lambda trigger to automatically confirm the user and set their email as verified. Per the AWS documentation, "Amazon Cognito passes event information to your Lambda function. The function then…
Eric Spiegelberg
  • 602
  • 1
  • 8
  • 14
2
votes
1 answer

AWS Cognito UserMigration_ForgotPassword not trigger on forgot_password flow

I am doing an authentication project with Cognito and I am trying to migrate my user to cognito pool with UserMigration in custom trigger flow using forgot password flow (following documentation, there are 2 ways to trigger this are sign-in and…
prachyab
  • 101
  • 1
  • 12
2
votes
1 answer

Cognito Post Confirmation Trigger adminAddUserToGroup: "Invalid lambda function output : Invalid JSON"

I set the following lambda function as the post-confirmation trigger in Cognito. Anyone know why I'm receiving "Invalid lambda function output : Invalid JSON"? I'm getting log from "console.log("params", params)" in CloudWatch but not from…
2
votes
2 answers

Is the Access Token for a Cognito user available serverside?

I'm dealing with the issue of users not explicitly logging out of a web application after use, which is not secure enough for the use case. It is a React app with AWS Amplify and Cognito. I plan to do this by tracking sessions in a database (I can…
2
votes
2 answers

How to use Forgot password custom template on .net using AWS cognito?

I'm sending a custom email using cognito for forgot password.Where do i need to set the code without trigger lambda?
2
votes
1 answer

AWS Cognito node lambda migration user : authenticateUser is not defined

I would like to migrate users from userPool 1 to userPool 2 with the migration user lambda in AWS Console function. In order to do it, I have used the script provided by AWS but I can't find how I can use authenticateUser for instance. It is not…
2
votes
2 answers

Cognito User Pool - Post confirmation trigger, access denied exception

I am crating a Cognito user pool using GO SDK, I am using the API CreateUserPoolInput. I have a post confirmation trigger, for this lambda function. So when the user confirmation happens, this lambda function is expected to trigger. But I am…
1
vote
0 answers

Is it possible to invoke SOFTWARE_TOKEN_MFA challenge (or any other MFA challenge) in Cognito from CUSTOM_AUTH flow?

We have an app that uses Cognito to authenticate users and process MFA. We also use CUSTOM_AUTH flow because we need to use CUSTOM_CHALLENGE with defineauth, createauth, and verifyauth lambdas that allow us to handle email MFA that Cognito doesn't…
1
vote
0 answers

Correct way to use KMS Decrypt in Cognito Custom Email Sender Lambda

I have an AWS Cognito User configured with a Custom Email Sender as follows: resource "aws_kms_key" "cognito-send-mails" { description = "This key is used to decrypt Cognito codes for CustomEmailSender lambda" deletion_window_in_days…
1
vote
0 answers

AWS Cognito returns 'No email provided but email_verified was true' after adding migration

I have added migration between two user pools. The following are the actions I took : create lambda function based on sample code given by AWS docs for cognito…
1
vote
1 answer

When is the CustomEmailSender_UpdateUserAttribute trigger source used?

I have set up a custom email sender function that currently just decrypts the code (if present) and logs the event. I can see in the logs that the lambda is correctly triggered for the other trigger source types such as…
wwags33
  • 13
  • 3
1
vote
1 answer

How to invoke lambda with Cognito event/trigger in serverless-offline for local test

I'm trying to write a trio of Cognito AuthChallenge lambdas for custom auth flow. I wanted to use serverless-offline to develop and test the lambdas locally with nodejs (also in jest tests in cicd pipeline). For example, here is a simplified handler…
1
vote
1 answer

Updating custom user attributes on AWS cognito with a number value (via a post confirmation trigger / lambda function)

I have a lambda trigger in my user pool (post confirmation lambda trigger), which calls the code below: sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session", err.Error()) } svc :=…
1
vote
0 answers

Cognito Migration Lambda Trigger

The migration lambda works as expected and the user is created after I edit the response and call context.succeed(event) as follows: email: email, email_verified: 'true', 'custom:mid': `${MID!}`, }; …