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?

Fergal
已提問 3 個月前檢視次數 123 次
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 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南