Verification codes other than the first one are not working #138
-
Describe the bugI'm not actually sure whether this is SDK or Cognito problem or maybe I just missed something, but any help would be much appreciated. I have a user pool set up in AWS Cognito. I've created a user and made it confirmed be changing the password via I'm trying to implement 'Forgot Password' feature in my system. After making a 'ForgotPasswordAsync' I successfully receive a verification code. However, I also try to implement a 'Resend verification code' feature. And whilst I do receive a new code, I get an 'Invalid verification code' exception. And this happens for every code other than the first one. I thought that maybe there is some time that enables new codes, but I've tried to wait 1, 5 and 10 minutes and no success was accomplished. As I said, the first one received is working with no issues whatsoever. Expected BehaviorAny received code should work or at least the latest one. Current BehaviorOnly the first code received works Reproduction Steps
Possible SolutionNo solutions were found Additional Information/ContextNo response AWS .NET SDK and/or Package version usedAmazon.Extensions.CognitoAuthentication: 2.5.2 Targeted .NET Platform.NET 6 Operating System and versionWindows 10, AmazonLinux (docker container) |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Needs investigation. |
Beta Was this translation helpful? Give feedback.
-
@MixaKonan Good afternoon. I'm not sure if you are using the correct logic. The ConfirmForgotPassword is the service API operation invoked by CognitoUser.ConfirmForgotPasswordAsync(). How are you sending the verification code?
The ResendConfirmationCode API call Thanks, |
Beta Was this translation helpful? Give feedback.
-
@ashishdhingra Good afternoon to you too. Indeed you were correct in your assumptions and I was actually using incorrect flow. I missed the difference between 'confirmation code' and 'password reset code' and it's actually stated in the documentation that 'ResendConfirmationCode' is used for registration only.
The issue is resolved and I will close it. Thank you very much for your support and the time wasted. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
@MixaKonan Good afternoon. I'm not sure if you are using the correct logic. The ConfirmForgotPassword is the service API operation invoked by CognitoUser.ConfirmForgotPasswordAsync().
How are you sending the verification code?
The ResendConfirmationCode API call
Resends the confirmation (for confirmation of registration) to a specific user in the user pool.
. In your use case, user is already registered. SoResendConfirmationCode
is not valid for forgot password scenario. You…