Closed kirgy closed 8 months ago
@kirgy, apologies for the delayed response on this. Were you still experiencing the issue? And was the phone_number
initially set up as a required attribute for the Cognito User Pool?
@cwomack thanks for following up, apologies for my own lack of follow-up.
During more invesigation I discovered a simularly named method in the docs:
verifyCurrentUserAttributeSubmit
found here.
It seems the user flow should be:
It was my presumption all 2FA code to be submitted consumed a common endpoint to submit them, but that's not the case. It may be useful if the docs spelt that out so simpletons like me can find a route forward 😅
I think this is a non-issue and can be closed. Potential room for documentation improvements. Thank you for your time 🙏
@kirgy, appreciate the follow up and clarity! I'll close out this issue then, but feel free to comment back or open a new one if there's further blockers.
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
REST API
Amplify Categories
api
Environment information
Describe the bug
A call to
Auth.confirmSignIn(signedInUser, code, "SMS_MFA")
with a validsignedinUser
, containing a validSession
produces an unexpected error response fromCognito
:InvalidParameterException: Missing required parameter Session
Expected behavior
I'd expect to see the
Session
object to be attached to theuser
, and this session sent with the request, and the API (Auth.confirmSignIn(signedInUser, code, "SMS_MFA")
) to respond accordingly.Reproduction steps
SMS
(we're calling this programatically before theverifyCurrentUserAttribute
andconfirmSignIn
phone_number
should be set as not verified in Cognitouser
or get a valid authenticated user objectawait Auth.verifyCurrentUserAttribute("phone_attribute");
Auth.confirmSignIn(signedInUser, code, "SMS_MFA");
Code Snippet
I'm trying to verify an existing authenticated Cognito user's
phone_number
under their user attributes.In our case, some users don't require MFA, and later business rules mean they now need to require it. When calling the
verifyCurrentUserAttribute
function onAuth
, I'm being returned an error:For example, calling the following:
I get an SMS MFA message, but a subsequent follow up request of:
Results in an error of:
I can observe in network traffic that the user object sent to Cognito indeed has
Session: null
attached to it. Observing theuser
andsignedInUser
objects above do show a populated Session object.Any advise here will be appreciated. This issue was also raised under the Discord, but unfortunately I had no response.
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
iOS Sim - iPhone 14
Mobile Operating System
iOS16.4
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response