Interface PasswordPolicy
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
PasswordPolicy.Jsii$Proxy
@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)",
date="2025-12-05T22:26:33.344Z")
@Stability(Stable)
public interface PasswordPolicy
extends software.amazon.jsii.JsiiSerializable
Password policy for User Pools.
Example:
UserPool.Builder.create(this, "myuserpool")
// ...
.passwordPolicy(PasswordPolicy.builder()
.minLength(12)
.requireLowercase(true)
.requireUppercase(true)
.requireDigits(true)
.requireSymbols(true)
.tempPasswordValidity(Duration.days(3))
.build())
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forPasswordPolicystatic final classAn implementation forPasswordPolicy -
Method Summary
Modifier and TypeMethodDescriptionstatic PasswordPolicy.Builderbuilder()default NumberMinimum length required for a user's password.default NumberThe number of previous passwords that you want Amazon Cognito to restrict each user from reusing.default BooleanWhether the user is required to have digits in their password.default BooleanWhether the user is required to have lowercase characters in their password.default BooleanWhether the user is required to have symbols in their password.default BooleanWhether the user is required to have uppercase characters in their password.default DurationThe length of time the temporary password generated by an admin is valid.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getMinLength
Minimum length required for a user's password.Default: 8
-
getPasswordHistorySize
The number of previous passwords that you want Amazon Cognito to restrict each user from reusing.passwordHistorySizecan not be set whenfeaturePlanisFeaturePlan.LITE.Default: undefined - Cognito default setting is no restriction
-
getRequireDigits
Whether the user is required to have digits in their password.Default: true
-
getRequireLowercase
Whether the user is required to have lowercase characters in their password.Default: true
-
getRequireSymbols
Whether the user is required to have symbols in their password.Default: true
-
getRequireUppercase
Whether the user is required to have uppercase characters in their password.Default: true
-
getTempPasswordValidity
The length of time the temporary password generated by an admin is valid.This must be provided as whole days, like Duration.days(3) or Duration.hours(48). Fractional days, such as Duration.hours(20), will generate an error.
Default: Duration.days(7)
-
builder
- Returns:
- a
PasswordPolicy.BuilderofPasswordPolicy
-