Lambda Exception

0

We are using customauth for cognito for verify auth challenge lambda we are using below handler

public CognitoUserPoolVerifyAuthChallengeResponseEvent handleRequest(CognitoUserPoolVerifyAuthChallengeResponseEvent cognitoUserPoolVerifyAuthChallengeResponseEvent, Context context)

we are getting the below error "An error occurred during JSON parsing: java.lang.RuntimeException java.lang.RuntimeException: An error occurred during JSON parsing Caused by: java.io.UncheckedIOException: com.amazonaws.lambda.thirdparty.com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of java.util.LinkedHashMap (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value"

asked 8 months ago276 views
1 Answer
0

Hi, Can you check the json structure passed in the CognitoUserPoolVerifyAuthChallengeResponseEvent.Request? The request should be in the format { "request": { "userAttributes": { "string": "string", . . . }, "privateChallengeParameters": { "string": "string", . . . }, "challengeAnswer": "string", "clientMetadata": { "string": "string", . . . }, "userNotFound": boolean }, "response": { "answerCorrect": boolean } }.

The json object "privateChallengeParameters" is usually generated in the previous Create auth challenge lambda. Pls verify that structure is getting generated correctly along with the structure of the entire request. Please refer to the following links for further details. https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html

https://javadoc.io/static/com.amazonaws/aws-lambda-java-events/3.11.0/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolVerifyAuthChallengeResponseEvent.Request.html

AWS
Joyanta
answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions