- Newest
- Most votes
- Most comments
In AWS Cognito Lambda triggers, the create auth challenge
trigger does not have direct access to the user input values (such as mobile number or email) provided during sign-in. However, you can include this information in the challenge parameters when you create the authentication challenge.
First, capture the user input (email or mobile number) and store it in a DynamoDB table or another storage associated with the user.
Then create Auth Challenge Trigger to retrieve the user input from the storage based on the user's unique identifier (e.g., Cognito username) and include it in the challenge parameters. This way, the information will be available during the challenge.
You can modify your code, so that the signIn
function now takes a username
parameter instead of a number, and if there's a UsernameExistsException
, it recursively calls itself with the same username
. This ensures that the correct username is used throughout the sign-in process.
Reference:
Relevant content
- Accepted Answerasked 6 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 4 months ago