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
已提問 5 個月前檢視次數 98 次
沒有答案

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

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

回答問題指南