Cognito User Pool Custom Authentication Flow does not trigger PreAuthentication Lambda

0

Hi All - We have a use case where before generating the one time passcode via SMS (With Create Auth Challenge Lambda), we need to identify the user's mobile platform so that within create auth challenge lambda we could execute the required logic. According to the Cognito doc, PreAuthentication lambda should get invoked every time a sign In attempt (Or initiateAuth) is made. That seemed to be the appropriate place to store the mobile platform (coming via User Matadata/validation data in request) so that create auth challenge can look it up against the user. However, we found the preauthentication Lambda trigger is not triggering at all (For Custom Auth Flow). We also noticed (via AWS CLI) that when we change the auth flow to User Password, it does get invoked. Please let me know what I could be doing wrong. Or if this is the expected behavior then: 1. Documentation link, where it clearly states that and 2. What could be the best way to achieve what I am looking for in the above use case? Thanks in advance.

Rahul
asked 4 months ago86 views
No Answers

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