0

I want to use adminInitiateAuth to trigger User Migration lambda function, but my code gives me below error:

"errorType": "UserLambdaValidationException",

"errorMessage": "PreAuthentication failed with error Bad triggerSource PreAuthentication_Authentication.",
  "trace": [
    "UserLambdaValidationException: PreAuthentication failed with error Bad triggerSource PreAuthentication_Authentication.",

Code is as below:

const AWS = require('aws-sdk')

const cognito = new AWS.CognitoIdentityServiceProvider()
const params = {
      AuthFlow: "ADMIN_NO_SRP_AUTH",
      UserPoolId: 'eu-west-2_1111111',
      ClientId: '722222222222',
      AuthParameters: {
          USERNAME: email,
          PASSWORD: password
      }
}
const response = await cognito.adminInitiateAuth(params).promise();

This code works fine for another user pool in the same account.

shamila
  • 1,280
  • 6
  • 20
  • 45

1 Answers1

0

It appears that a lambda trigger is set up on the pool that fails and is not operating correctly in some way.

M Akin
  • 446
  • 6
  • 18