I am investigating the recently released migration trigger for cognito user pools. To enable the trigger you need to set the AuthFlow type in the InitiateAuthRequest to be "USER_PASSWORD_AUTH" see here: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-import-using-lambda.html
I want to use the custom auth flow so that I can return a challenge response for email verification is the users are not email verified from the existing user store. However if I set the AuthFlow type to "CUSTOM_AUTH" then the migration trigger is not fired.
Is there a way to get custom auth and migration working at the same time?
Example code:
var client = new AmazonCognitoIdentityProviderClient(Amazon.RegionEndpoint.APSoutheast2);
var authRequest = new InitiateAuthRequest
{
ClientId = "*********",
AuthFlow = "USER_PASSWORD_AUTH" // Or AuthFlow = "CUSTOM_AUTH"
};
authRequest.AuthParameters.Add("USERNAME", username);
authRequest.AuthParameters.Add("PASSWORD", password);
var response = await client.InitiateAuthAsync(authRequest);