public class AdminSetUserPasswordRequest
extends com.amazonaws.AmazonWebServiceRequest
implements java.io.Serializable
Sets the specified user's password in a user pool as an administrator. Works on any user.
The password can be temporary or permanent. If it is temporary, the user
status enters the FORCE_CHANGE_PASSWORD state. When the user
next tries to sign in, the InitiateAuth/AdminInitiateAuth response will
contain the NEW_PASSWORD_REQUIRED challenge. If the user doesn't
sign in before it expires, the user won't be able to sign in, and an
administrator must reset their password.
Once the user has set a new password, or the password is permanent, the user
status is set to Confirmed.
AdminSetUserPassword can set a password for the user profile
that Amazon Cognito creates for third-party federated users. When you set a
password, the federated user's status changes from
EXTERNAL_PROVIDER to CONFIRMED. A user in this
state can sign in as a federated user, and initiate authentication flows in
the API like a linked native user. They can also modify their password and
attributes in token-authenticated API requests like
ChangePassword and UpdateUserAttributes. As a best
security practice and to keep users in sync with your external IdP, don't set
passwords on federated user profiles. To set up a federated user for native
sign-in with a linked native user, refer to Linking federated users to an existing user profile.
Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.
Learn more
| Constructor and Description |
|---|
AdminSetUserPasswordRequest() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getPassword()
The password for the user.
|
java.lang.Boolean |
getPermanent()
True if the password is permanent, False if it
is temporary. |
java.lang.String |
getUsername()
The user name of the user whose password you want to set.
|
java.lang.String |
getUserPoolId()
The user pool ID for the user pool where you want to set the user's
password.
|
int |
hashCode() |
java.lang.Boolean |
isPermanent()
True if the password is permanent, False if it
is temporary. |
void |
setPassword(java.lang.String password)
The password for the user.
|
void |
setPermanent(java.lang.Boolean permanent)
True if the password is permanent, False if it
is temporary. |
void |
setUsername(java.lang.String username)
The user name of the user whose password you want to set.
|
void |
setUserPoolId(java.lang.String userPoolId)
The user pool ID for the user pool where you want to set the user's
password.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
AdminSetUserPasswordRequest |
withPassword(java.lang.String password)
The password for the user.
|
AdminSetUserPasswordRequest |
withPermanent(java.lang.Boolean permanent)
True if the password is permanent, False if it
is temporary. |
AdminSetUserPasswordRequest |
withUsername(java.lang.String username)
The user name of the user whose password you want to set.
|
AdminSetUserPasswordRequest |
withUserPoolId(java.lang.String userPoolId)
The user pool ID for the user pool where you want to set the user's
password.
|
clone, copyBaseTo, getCloneRoot, getCloneSource, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollectorpublic java.lang.String getUserPoolId()
The user pool ID for the user pool where you want to set the user's password.
Constraints:
Length: 1 - 55
Pattern: [\w-]+_[0-9a-zA-Z]+
The user pool ID for the user pool where you want to set the user's password.
public void setUserPoolId(java.lang.String userPoolId)
The user pool ID for the user pool where you want to set the user's password.
Constraints:
Length: 1 - 55
Pattern: [\w-]+_[0-9a-zA-Z]+
userPoolId - The user pool ID for the user pool where you want to set the user's password.
public AdminSetUserPasswordRequest withUserPoolId(java.lang.String userPoolId)
The user pool ID for the user pool where you want to set the user's password.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 55
Pattern: [\w-]+_[0-9a-zA-Z]+
userPoolId - The user pool ID for the user pool where you want to set the user's password.
public java.lang.String getUsername()
The user name of the user whose password you want to set.
Constraints:
Length: 1 - 128
Pattern: [\p{L}\p{M}\p{S}\p{N}\p{P}]+
The user name of the user whose password you want to set.
public void setUsername(java.lang.String username)
The user name of the user whose password you want to set.
Constraints:
Length: 1 - 128
Pattern: [\p{L}\p{M}\p{S}\p{N}\p{P}]+
username - The user name of the user whose password you want to set.
public AdminSetUserPasswordRequest withUsername(java.lang.String username)
The user name of the user whose password you want to set.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 128
Pattern: [\p{L}\p{M}\p{S}\p{N}\p{P}]+
username - The user name of the user whose password you want to set.
public java.lang.String getPassword()
The password for the user.
Constraints:
Length: - 256
Pattern: [\S]+
The password for the user.
public void setPassword(java.lang.String password)
The password for the user.
Constraints:
Length: - 256
Pattern: [\S]+
password - The password for the user.
public AdminSetUserPasswordRequest withPassword(java.lang.String password)
The password for the user.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: - 256
Pattern: [\S]+
password - The password for the user.
public java.lang.Boolean isPermanent()
True if the password is permanent, False if it
is temporary.
True if the password is permanent,
False if it is temporary.
public java.lang.Boolean getPermanent()
True if the password is permanent, False if it
is temporary.
True if the password is permanent,
False if it is temporary.
public void setPermanent(java.lang.Boolean permanent)
True if the password is permanent, False if it
is temporary.
permanent -
True if the password is permanent,
False if it is temporary.
public AdminSetUserPasswordRequest withPermanent(java.lang.Boolean permanent)
True if the password is permanent, False if it
is temporary.
Returns a reference to this object so that method calls can be chained together.
permanent -
True if the password is permanent,
False if it is temporary.
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object