update_login_profile
async
¶
update_login_profile(
user_name: userNameType,
*,
config_overrides: Optional[AsyncIAMClientConfig] = None,
password: Optional[passwordType] = None,
password_reset_required: Optional[booleanObjectType] = None,
max_signin_session_duration: Optional[maxSigninSessionDurationType] = None,
reset_max_signin_session_duration: Optional[booleanObjectType] = None,
) -> None
Changes the password or the maximum sign-in session duration for the specified IAM user. You can use the CLI, the Amazon Web Services API, or the Users page in the IAM console to change the password for any IAM user. Use ChangePassword to change your own password in the My Security Credentials page in the Amazon Web Services Management Console.
For more information about modifying passwords, see Managing passwords in the IAM User Guide.
Parameters:
-
user_name(userNameType) –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: _+=,.@-
-
password(Optional[passwordType], default:None) –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 Amazon Web Services account. For more information, see UpdateAccountPasswordPolicy.
-
-
password_reset_required(Optional[booleanObjectType], default:None) –Allows this new password to be used only once by requiring the specified IAM user to set a new password on next sign-in.
-
max_signin_session_duration(Optional[maxSigninSessionDurationType], default:None) –The maximum duration (in seconds) of an Amazon Web Services Sign-In session that uses the specified IAM user's login profile (user name and password). This setting can have a value from 1 hour (3600 seconds) to 90 days (7776000 seconds), inclusive.
This setting applies only to sessions created through OAuth-based flows (
signin:CreateOAuth2Token). It does not affect Amazon Web Services Management Console browser sessions or traditional STS sessions.If you omit both this parameter and
ResetMaxSigninSessionDuration, the current setting is unchanged. You cannot specify this parameter and setResetMaxSigninSessionDurationtotruein the same request. If you update only the sign-in session duration, the user's password andPasswordResetRequiredsetting do not change.Changes to this setting apply to new sign-in sessions. Sessions that are already established are not affected.
This setting is not supported for the root user.
-
reset_max_signin_session_duration(Optional[booleanObjectType], default:None) –Specifies whether to clear the maximum sign-in session duration on the specified IAM user's login profile. Set this value to
trueto return the setting to its unset state, so that the existing sign-in session behavior applies.If you set this value to
falseor omit it, the current setting is not cleared. You cannot set this value totrueand specifyMaxSigninSessionDurationin the same request. Clearing a setting that is already unset has no effect.
Raises:
-
EntityTemporarilyUnmodifiableException–The request was rejected because it referenced an entity that is temporarily unmodifiable, such as a user name that was deleted and then recreated. The error indicates that the request is likely to succeed if you try again after waiting several minutes. The error message describes the entity.
-
InvalidInputException–The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
-
LimitExceededException–The request was rejected because it attempted to create resources beyond the current Amazon Web Services account limits. The error message describes the limit exceeded.
-
NoSuchEntityException–The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.
-
PasswordPolicyViolationException–The request was rejected because the provided password did not meet the requirements imposed by the account password policy.
-
ServiceFailureException–The request processing has failed because of an unknown error, exception or failure.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To change the password for an IAM user The following command creates or changes the password for the IAM user named Bob.
Source code in docs_src/capo_iam/_services/async_iam.py
12673 12674 12675 12676 12677 12678 12679 12680 12681 12682 12683 12684 12685 12686 12687 12688 12689 12690 12691 12692 12693 12694 12695 12696 12697 12698 12699 12700 12701 12702 12703 12704 12705 12706 12707 12708 12709 12710 12711 12712 12713 12714 12715 12716 12717 12718 12719 12720 12721 12722 12723 12724 12725 12726 12727 12728 12729 12730 12731 12732 12733 12734 12735 12736 12737 12738 12739 12740 12741 12742 12743 12744 12745 12746 12747 12748 12749 12750 12751 12752 12753 12754 12755 12756 12757 12758 | |