SignInPolicy Struct
Sign-in policy for User Pools.
Example
ts
new cognito.UserPool(this, 'myuserpool', {
signInPolicy: {
allowedFirstAuthFactors: { password: true, passkey: true },
},
passkeyRelyingPartyId: 'auth.example.com',
passkeyUserVerification: cognito.PasskeyUserVerification.REQUIRED,
});
python
cognito.UserPool(self, "myuserpool",
sign_in_policy=cognito.SignInPolicy(
allowed_first_auth_factors=cognito.AllowedFirstAuthFactors(password=True, passkey=True)
),
passkey_relying_party_id="auth.example.com",
passkey_user_verification=cognito.PasskeyUserVerification.REQUIRED
)
java
UserPool.Builder.create(this, "myuserpool")
.signInPolicy(SignInPolicy.builder()
.allowedFirstAuthFactors(AllowedFirstAuthFactors.builder().password(true).passkey(true).build())
.build())
.passkeyRelyingPartyId("auth.example.com")
.passkeyUserVerification(PasskeyUserVerification.REQUIRED)
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
new UserPool(this, "myuserpool", new UserPoolProps {
SignInPolicy = new SignInPolicy {
AllowedFirstAuthFactors = new AllowedFirstAuthFactors { Password = true, Passkey = true }
},
PasskeyRelyingPartyId = "auth.example.com",
PasskeyUserVerification = PasskeyUserVerification.REQUIRED
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
cognito.NewUserPool(this, jsii.String("myuserpool"), &UserPoolProps{
SignInPolicy: &SignInPolicy{
AllowedFirstAuthFactors: &AllowedFirstAuthFactors{
Password: jsii.Boolean(true),
Passkey: jsii.Boolean(true),
},
},
PasskeyRelyingPartyId: jsii.String("auth.example.com"),
PasskeyUserVerification: cognito.PasskeyUserVerification_REQUIRED,
})
Properties
allowedFirstAuthFactorsoptionalAllowedFirstAuthFactorsallowed_first_auth_factorsoptionalAllowedFirstAuthFactorsallowedFirstAuthFactorsoptionalAllowedFirstAuthFactorsAllowedFirstAuthFactorsoptionalAllowedFirstAuthFactorsAllowedFirstAuthFactorsoptionalAllowedFirstAuthFactors#The types of authentication that you want to allow for users' first authentication prompt.
Default: Password only