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.
[2] AWS Lambda UserMigration_ForgotPassword Trigger | Not Migrating Users