Interface IPasswordPolicy
Password policy for User Pools.
Namespace: Amazon.CDK.AWS.Cognito
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IPasswordPolicy
Syntax (vb)
Public Interface IPasswordPolicy
Remarks
ExampleMetadata: infused
Examples
new UserPool(this, "myuserpool", new UserPoolProps {
// ...
PasswordPolicy = new PasswordPolicy {
MinLength = 12,
RequireLowercase = true,
RequireUppercase = true,
RequireDigits = true,
RequireSymbols = true,
TempPasswordValidity = Duration.Days(3)
}
});
Synopsis
Properties
MinLength | Minimum length required for a user's password. |
RequireDigits | Whether the user is required to have digits in their password. |
RequireLowercase | Whether the user is required to have lowercase characters in their password. |
RequireSymbols | Whether the user is required to have symbols in their password. |
RequireUppercase | Whether the user is required to have uppercase characters in their password. |
TempPasswordValidity | The length of time the temporary password generated by an admin is valid. |
Properties
MinLength
Minimum length required for a user's password.
virtual Nullable<double> MinLength { get; }
Property Value
System.Nullable<System.Double>
Remarks
Default: 8
RequireDigits
Whether the user is required to have digits in their password.
virtual Nullable<bool> RequireDigits { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
RequireLowercase
Whether the user is required to have lowercase characters in their password.
virtual Nullable<bool> RequireLowercase { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
RequireSymbols
Whether the user is required to have symbols in their password.
virtual Nullable<bool> RequireSymbols { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
RequireUppercase
Whether the user is required to have uppercase characters in their password.
virtual Nullable<bool> RequireUppercase { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
TempPasswordValidity
The length of time the temporary password generated by an admin is valid.
virtual Duration TempPasswordValidity { get; }
Property Value
Remarks
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)