aws / aws-tools-for-powershell

The AWS Tools for PowerShell lets developers and administrators manage their AWS services from the PowerShell scripting environment.
Apache License 2.0
235 stars 78 forks source link

Set-CGIPUserMFAPreferenceAdmin SMSMfaSetting not setting to false #163

Closed sbe-arg closed 1 year ago

sbe-arg commented 4 years ago

Running on MacOS, Powershell 7 AWSPowershell.Netcore 4.0.5.0 Core Runtime Version 3.3.104.35

$SMSMfaSetting = New-Object -TypeName 'Amazon.CognitoIdentityProvider.Model.SMSMfaSettingsType'
$SMSMfaSetting.Enabled = 'false'
$SMSMfaSetting.PreferredMfa = 'false'
Set-CGIPUserMFAPreferenceAdmin -UserPoolId $poolid -Username $usernameoremail -SMSMfaSetting $SMSMfaSetting -Force -Select '*'
HttpStatusCode=Ok

$SoftwareTokenMfaSetting = New-Object -TypeName 'Amazon.CognitoIdentityProvider.Model.SoftwareTokenMfaSettingsType'
$SoftwareTokenMfaSetting.Enabled = 'false'
$SoftwareTokenMfaSetting.PreferredMfa = 'false'
Set-CGIPUserMFAPreferenceAdmin -UserPoolId $poolid -Username $usernameoremail -SoftwareTokenMfaSetting $SoftwareTokenMfaSetting -Force -Select '*'
HttpStatusCode=Ok

Both MFA setups run and respond Ok. You can enable and disable Software mfa just fine, SMS does get enabled but not disabled when set to false|false.

While running in bash does work:

aws cognito-idp admin-set-user-mfa-preference --user-pool-id $poolid --username $email --sms-mfa-settings Enabled=false,PreferredMfa=false

I have ran out of ideas atm. We also tried running this from Windows2019Core. PS.5, with the same results.

sbe-arg commented 4 years ago

Any update on replicating this issue?

ashishdhingra commented 2 years ago

@sbe-arg Could you please share your Cognito user pool and app client settings (if possible with screenshots) to reproduce the issue? I noticed some inconsistent behavior with the default settings, so it would be helpful if you could share this information.

github-actions[bot] commented 1 year ago

We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.