adminSetUserSettings method
This action is no longer supported. You can use it to configure only SMS MFA. You can't use it to configure time-based one-time password (TOTP) software token MFA.
Learn more
- Signing Amazon Web Services API Requests
- Using the Amazon Cognito user pools API and user pool endpoints
May throw InternalErrorException.
May throw InvalidParameterException.
May throw NotAuthorizedException.
May throw OperationNotEnabledException.
May throw ResourceNotFoundException.
May throw UserNotFoundException.
Parameter mFAOptions :
You can use this parameter only to set an SMS configuration that uses SMS
for delivery.
Parameter userPoolId :
The ID of the user pool that contains the user whose options you're
setting.
Parameter username :
The name of the user that you want to query or modify. The value of this
parameter is typically your user's username, but it can be any of their
alias attributes. If username isn't an alias attribute in
your user pool, this value must be the sub of a local user or
the username of a user from a third-party IdP.
Implementation
Future<void> adminSetUserSettings({
required List<MFAOptionType> mFAOptions,
required String userPoolId,
required String username,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSCognitoIdentityProviderService.AdminSetUserSettings'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'MFAOptions': mFAOptions,
'UserPoolId': userPoolId,
'Username': username,
},
);
}