setUserSettings 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 or email MFA.
Authorize this action with a signed-in user's access token. It must
include the scope aws.cognito.signin.user.admin.
May throw ForbiddenException.
May throw InternalErrorException.
May throw InvalidParameterException.
May throw NotAuthorizedException.
May throw OperationNotEnabledException.
May throw PasswordResetRequiredException.
May throw ResourceNotFoundException.
May throw UserNotConfirmedException.
May throw UserNotFoundException.
Parameter accessToken :
A valid access token that Amazon Cognito issued to the currently signed-in
user. Must include a scope claim for
aws.cognito.signin.user.admin.
Parameter mFAOptions :
You can use this parameter only to set an SMS configuration that uses SMS
for delivery.
Implementation
Future<void> setUserSettings({
required String accessToken,
required List<MFAOptionType> mFAOptions,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSCognitoIdentityProviderService.SetUserSettings'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
signed: false,
// TODO queryParams
headers: headers,
payload: {
'AccessToken': accessToken,
'MFAOptions': mFAOptions,
},
);
}