- Newest
- Most votes
- Most comments
Thank you for providing detailed information about the issue you're experiencing with Amazon Cognito's custom authentication flow and SRP (Secure Remote Password) authentication. Based on the information you've provided and the expected behavior described in the documentation, it does appear that there might be a discrepancy between the documented behavior and what you're observing.
The expected behavior, as per the documentation, is that after Amazon Cognito verifies the password using SRP, it should invoke the DefineAuthChallenge Lambda trigger with a second session of challengeName: PASSWORD_VERIFIER and challengeResult: true. However, you're observing that Cognito is directly issuing tokens instead of calling the DefineAuthChallenge Lambda function.
This behavior is indeed unexpected and could potentially be a bug in the Cognito service. However, before concluding that it's definitely a bug, there are a few things you might want to consider or try:
-
Double-check that your Lambda function for DefineAuthChallenge is correctly configured and associated with your Cognito User Pool.
-
Ensure that the CUSTOM_AUTH flow is properly set up for your app client in the Cognito User Pool settings.
-
Verify that there are no recent changes in your Cognito configuration that might have affected this behavior.
-
Try creating a new User Pool and app client with the same configuration to see if the issue persists.
-
Check if there are any error messages or unexpected entries in your CloudWatch logs related to the authentication flow or Lambda invocation.
If after these checks the issue still persists, it would be advisable to contact AWS Support. They can investigate further and confirm if this is indeed a bug in the Cognito service. When contacting support, provide them with the detailed steps to reproduce the issue that you've outlined, along with any relevant logs and configuration details.
It's worth noting that Amazon Cognito's advanced security features have been enhanced to cover custom authentication flows, so there might be some changes or updates in the authentication process that are not yet reflected in the documentation.
In the meantime, if you need to implement additional challenges after SRP authentication, you might need to explore alternative approaches or workarounds until this issue is resolved.
Sources
User pool authentication flow - Amazon Cognito
Adding threat detection to custom authentication flow with Amazon Cognito advanced security features | AWS Security Blog
Amazon Cognito enhances Advanced Security Features (ASF) to detect additional risks and to cover custom authentication flows - AWS
Relevant content
- asked 2 years ago
