-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix getMFAOptions data extraction #2707
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sjawhar - Currently reviewing and testing this.
@sjawhar - Since the name of the function you've updated is getMFAOptions, I think it makes sense that it returns the MFAOptions value. What are your thoughts on creating a similar function called getMFASettings to return the values that your PR currently adds to getMFAOptions? If you do not want to make this update it's ok - we can take it on. Thanks again for submitting this PR and apologies for the delayed response. |
The problem is that |
@sjawhar Yes - MFAOptions will only be defined if SMS MFA settings are enabled. Getting the setting variables that you are using in the PR is a fine solution for more comprehensive data; however, I think it would be good to retrieve these in a seperate function. There may be some developers who are using MFAOptions in scenarios where it does bring back data, and suddently giving them additional properties in the response is less desirable than providing a seperate function for developers to use going forward (IMO). |
@haverchuck I just ran through and tested it real quick. Tried when I have no MFA, when I have SMS, and when I have TOTP. |
@sjawhar I'm contacting the service team with this for additional info, please stay tuned. |
Just FYI on this the cognito team has an update that they will be pushing out to address this asap, will keep the thread posted once the update is complete! |
We have identified an issue in Amazon Cognito where the Admin/GetUser service response doesn’t correctly populate MFAOptions when on a pool with MFA required and the end user uses SMS MFA. We are actively working on the fix and will circle back when the service update is completed. Rachit, |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
LOL :D new technique to pretend Issues are being solved? Love It! :D |
Codecov Report
@@ Coverage Diff @@
## master #2707 +/- ##
=======================================
Coverage 73.74% 73.74%
=======================================
Files 203 203
Lines 11956 11956
Branches 2249 2335 +86
=======================================
Hits 8817 8817
+ Misses 2977 2957 -20
- Partials 162 182 +20
Continue to review full report at Codecov.
|
I'm touching base with @rachitdhall internally. The Cognito service is still behaving as described in the OP from what I can tell. But, I'm not actually clear as to what the correct behavior is there. I'll also need to base with @haverchuck, I think. I'm honestly not 100% sure how |
As it turns out, You could always use |
This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Description of changes:
cognitoUser.getMFAOptions()
is currently broken. It always returns undefined, becauseuserData.MFAOptions
is not defined. Instead, there are two keys inuserData
containing MFA info:UserMFASettingList
andPreferredMfaSetting
. So we should return those instead.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.