2

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 forgot-password [1]) on sign-in the trigger works properly but the problem occurs on forgot password, the trigger is not working, not any trigger in cloudwatch-log! I have been trying and searching many where but, still not working. Here is my lambda code with python boto3. that used on forgot-password:

def forgot_password(username):
    try:
        response = cognito_client.forgot_password(
            ClientId=MY_APP_CLIENT_ID,
            SecretHash=MY_SECRET_HASH,
            Username=username,
            ClientMetadata={"key":"value"}
        )
        return response
    except Exception as e:
        logging.error(e)

my expectation is the User Migration trigger should work and wake in forgot-password flow simply.

Thank you in advance for helping or answering this issue

Thanks a lot :)

Note: I also add ClientMetadata like in this question[2] but, the trigger is still not working as expected.

[1] https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-migrate-user.html#aws-lambda-triggers-user-migration-example-1

[2] AWS Lambda UserMigration_ForgotPassword Trigger | Not Migrating Users

prachyab
  • 101
  • 1
  • 12

1 Answers1

0

Not confident with python boto3, but I would suggest also to double check you're using USER_PASSWORD_AUTH flow → reference

alessio
  • 189
  • 1
  • 4
  • 12