set_user_pool_mfa_config
async
¶
set_user_pool_mfa_config(
user_pool_id: UserPoolIdType,
*,
config_overrides: Optional[AsyncCognitoIdentityProviderClientConfig] = None,
sms_mfa_configuration: Optional[SmsMfaConfigType] = None,
software_token_mfa_configuration: Optional[SoftwareTokenMfaConfigType] = None,
email_mfa_configuration: Optional[EmailMfaConfigType] = None,
mfa_configuration: Optional[UserPoolMfaType] = None,
web_authn_configuration: Optional[WebAuthnConfigurationType] = None,
) -> SetUserPoolMfaConfigResponse
Sets user pool multi-factor authentication (MFA) and passkey configuration. For more information about user pool MFA, see Adding MFA. For more information about WebAuthn passkeys see Authentication flows.
This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in.
If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide.
Parameters:
-
user_pool_id(UserPoolIdType) –The user pool ID.
-
sms_mfa_configuration(Optional[SmsMfaConfigType], default:None) –Configures user pool SMS messages for MFA. Sets the message template and the SMS message sending configuration for Amazon SNS.
-
software_token_mfa_configuration(Optional[SoftwareTokenMfaConfigType], default:None) –Configures a user pool for time-based one-time password (TOTP) MFA. Enables or disables TOTP.
-
email_mfa_configuration(Optional[EmailMfaConfigType], default:None) –Sets configuration for user pool email message MFA and sign-in with one-time passwords (OTPs). Includes the subject and body of the email message template for sign-in and MFA messages. To activate this setting, your user pool must be in the Essentials tier or higher.
-
mfa_configuration(Optional[UserPoolMfaType], default:None) –Sets multi-factor authentication (MFA) to be on, off, or optional. When
ON, all users must set up MFA before they can sign in. WhenOPTIONAL, your application must make a client-side determination of whether a user wants to register an MFA device. For user pools with adaptive authentication with threat protection, chooseOPTIONAL.When
MfaConfigurationisOPTIONAL, managed login doesn't automatically prompt users to set up MFA. Amazon Cognito generates MFA prompts in API responses and in managed login for users who have chosen and configured a preferred MFA factor. -
web_authn_configuration(Optional[WebAuthnConfigurationType], default:None) –The configuration of your user pool for passkey, or WebAuthn, authentication and registration. Includes relying-party configuration, user-verification requirements, and whether passkeys can satisfy MFA requirements.
Raises:
-
ConcurrentModificationException–This exception is thrown if two or more modifications are happening concurrently.
-
FeatureUnavailableInTierException–This exception is thrown when a feature that you attempted to use or configure isn't included in your user pool's current feature plan. This can occur when:
-
You configure a feature that your feature plan doesn't support.
-
You make a request that uses a feature that requires a higher feature plan.
To resolve this issue, upgrade your user pool to a feature plan that includes the feature.
-
-
InternalErrorException–This exception is thrown when Amazon Cognito encounters an internal error.
-
InvalidParameterException–This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
-
InvalidSmsRoleAccessPolicyException–This exception is returned when the role provided for SMS configuration doesn't have permission to publish using Amazon SNS.
-
InvalidSmsRoleTrustRelationshipException–This exception is thrown when the trust relationship is not valid for the role provided for SMS configuration. This can happen if you don't trust
cognito-idp.amazonaws.comor the external ID provided in the role does not match what is provided in the SMS configuration for the user pool. -
NotAuthorizedException–This exception is thrown when a user isn't authorized.
-
OperationNotEnabledException–This exception is thrown when an operation is not available in the current region or for the current user pool configuration. This can occur when attempting to perform operations that are not supported in secondary replica regions.
-
ResourceNotFoundException–This exception is thrown when the Amazon Cognito service can't find the requested resource.
-
TooManyRequestsException–This exception is thrown when the user has made too many requests for a given operation.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cognito_identity_provider/_services/async_cognito_identity_provider.py
9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 | |