Create User Lambda - Error during registration: InvalidLambdaResponseException: Unrecognizable lambda output

0

I have a user registration front end and when I register a user it sends the users details to Cognito and DynamoDB and works as it should, however in the frontend it wont work. The console says error during registration: InvalidLambdaResponseException: Unrecognizable lambda output. It works when I remove this auto confirm user code from the lambda function event['response']['autoConfirmUser'] = True and event['response']['autoVerifyEmail'] = True . Why is this breaking my front end?

1개 답변
0

The error indicates that the response returned from the user migration Lambda function is not in the format expected by Amazon Cognito. A few things to check:

  • Make sure the response includes all the required attributes that match the schema of your user pool. The error occurs if an attribute in the response is not defined in the schema.

  • Check that the username attribute matches the email attribute value that is being used to authenticate.

  • When testing with the CLI, the full response returned from the Lambda function needs to be serialized correctly. Make sure to return all top-level attributes like version , userPoolId , region etc. that were present in the original invocation event.

  • It's difficult to debug further without seeing the actual response. Try minimizing the response to only the required attributes and values to narrow down where it may be failing validation.

  • Verify that the Lambda execution role has sufficient permissions for Amazon Cognito to invoke the function and read the response.

profile picture
전문가
답변함 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠