Table of Contents

Interface IPasswordPolicy

Namespace
Amazon.CDK.AWS.Cognito
Assembly
Amazon.CDK.AWS.Cognito.dll

Password policy for User Pools.

public interface IPasswordPolicy

Examples

new UserPool(this, "myuserpool", new UserPoolProps {
                // ...
                PasswordPolicy = new PasswordPolicy {
                    MinLength = 12,
                    RequireLowercase = true,
                    RequireUppercase = true,
                    RequireDigits = true,
                    RequireSymbols = true,
                    TempPasswordValidity = Duration.Days(3)
                }
            });

Remarks

ExampleMetadata: infused

Properties

MinLength

Minimum length required for a user's password.

double? MinLength { get; }

Property Value

double?

Remarks

Default: 8

RequireDigits

Whether the user is required to have digits in their password.

bool? RequireDigits { get; }

Property Value

bool?

Remarks

Default: true

RequireLowercase

Whether the user is required to have lowercase characters in their password.

bool? RequireLowercase { get; }

Property Value

bool?

Remarks

Default: true

RequireSymbols

Whether the user is required to have symbols in their password.

bool? RequireSymbols { get; }

Property Value

bool?

Remarks

Default: true

RequireUppercase

Whether the user is required to have uppercase characters in their password.

bool? RequireUppercase { get; }

Property Value

bool?

Remarks

Default: true

TempPasswordValidity

The length of time the temporary password generated by an admin is valid.

Duration? TempPasswordValidity { get; }

Property Value

Duration

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)