updateLoginProfile method

Future<void> updateLoginProfile({
  1. required String userName,
  2. String? password,
  3. bool? passwordResetRequired,
})

Changes the password for the specified IAM user.

IAM users can change their own passwords by calling ChangePassword. For more information about modifying passwords, see Managing Passwords in the IAM User Guide.

May throw EntityTemporarilyUnmodifiableException. May throw NoSuchEntityException. May throw PasswordPolicyViolationException. May throw LimitExceededException. May throw ServiceFailureException.

Parameter userName : The name of the user whose password you want to update.

This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

Parameter password : The new password for the specified IAM user.

The regex pattern used to validate this parameter is a string of characters consisting of the following:

  • Any printable ASCII character ranging from the space character (\u0020) through the end of the ASCII character range
  • The printable characters in the Basic Latin and Latin-1 Supplement character set (through \u00FF)
  • The special characters tab (\u0009), line feed (\u000A), and carriage return (\u000D)
However, the format can be further restricted by the account administrator by setting a password policy on the AWS account. For more information, see UpdateAccountPasswordPolicy.

Parameter passwordResetRequired : Allows this new password to be used only once by requiring the specified IAM user to set a new password on next sign-in.

Implementation

Future<void> updateLoginProfile({
  required String userName,
  String? password,
  bool? passwordResetRequired,
}) async {
  ArgumentError.checkNotNull(userName, 'userName');
  _s.validateStringLength(
    'userName',
    userName,
    1,
    64,
    isRequired: true,
  );
  _s.validateStringLength(
    'password',
    password,
    1,
    128,
  );
  final $request = <String, dynamic>{};
  $request['UserName'] = userName;
  password?.also((arg) => $request['Password'] = arg);
  passwordResetRequired
      ?.also((arg) => $request['PasswordResetRequired'] = arg);
  await _protocol.send(
    $request,
    action: 'UpdateLoginProfile',
    version: '2010-05-08',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['UpdateLoginProfileRequest'],
    shapes: shapes,
  );
}