Closed jamie-digital closed 6 years ago
I think I understand what the issue is and adding a check for session being returned after the verify software token call should solve the issue (it wouldn't respond to auth challenge after) as you pointed out. Does the verifySoftwareToken API fail consistently or only once in a while as would be expected from a time based OTP?
cognitoUser.verifySoftwareToken
fails consistently when adding the TOTP device. The API call to VerifySoftwareToken
is succeeding every time, but cognitoUser.verifySoftwareToken
is always performing the RespondToAuthChallenge
API call, which fails. It's worth noting that I'm not seeing an auth challenge everywhere, so I'm not sure what the RespondToAuthChallenge
is in response to.
I'm afraid I don't quite understand what you mean by adding a check for session being returned; is this in my code or within the SDK?
Thanks for your help.
Got it! This should be fixed in the newest version 1.29.0. Fix is within the SDK that was making the unnecessary call.
Fantastic! This fixes the issue for me. Thanks a lot for your help.
I'm trying to enable MFA with a TOTP software device for a signed-in user.
cognitoUser.associateSoftwareToken
, which is working fine; the call returns the secret, which the user uses to configure their TOTP device.cognitoUser.verifySoftwareToken
, which is returning an error.AccessToken
, rather than aSession
, but that seems to work fine.AssociateSoftwareToken
andVerifySoftwareToken
both succeed, but neither returns aSession
in their response.cognitoUser.verifySoftwareToken
invokesVerifySoftwareToken
, it callsRespondToAuthChallenge
.Session
, as one hasn't been returned.RespondToAuthChallenge
returns a 400 response sayingInvalidParameterException: Missing required parameter Session
.Session
parameter should be optional, and as the previous call didn't return one, it looks like the SDK is fine not to offer one.In summary either:
RespondToAuthChallenge
or,RespondToAuthChallenge
without theSession
parameter.Happy to provide more info if it would be useful.