Skip to content

Commit 9a6e5cc

Browse files
authored
feat(cognito): choice-based authentication (passwordless sign-in / passkey sign-in) (#32369)
### Issue # (if applicable) Closes #32265. ### Reason for this change User Pool has introduced choice-based authentication, including passwordless sign-in and passkey (WebAuthn) sign-in. For details, see [Manage authentication methods in AWS SDKs](https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flows-selection-sdk.html). Related PRs: - #32367 - requires Essentials or higher feature plan - #32273 - requires User pool client to allow USER_AUTH auth flow ### Description of changes Added following properties: - `allowedFirstAuthFactors` - allowed first authenticate factors - `passkeyRelyingPartyId` - the authentication domain used as passkey relying party ID - `passkeyUserVerification` - configure user verification to be preferred or required ### Description of how you validated changes Added unit test and an integ test. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent b11f663 commit 9a6e5cc

12 files changed

+949
-2
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-passwordless.js.snapshot/IntegTestDefaultTestDeployAssertE3E7D2A4.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-passwordless.js.snapshot/IntegTestDefaultTestDeployAssertE3E7D2A4.template.json

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-passwordless.js.snapshot/cdk.out

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-passwordless.js.snapshot/integ-user-pool-passwordless.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
{
2+
"Resources": {
3+
"myuserpool01998219": {
4+
"Type": "AWS::Cognito::UserPool",
5+
"Properties": {
6+
"AccountRecoverySetting": {
7+
"RecoveryMechanisms": [
8+
{
9+
"Name": "verified_phone_number",
10+
"Priority": 1
11+
},
12+
{
13+
"Name": "verified_email",
14+
"Priority": 2
15+
}
16+
]
17+
},
18+
"AdminCreateUserConfig": {
19+
"AllowAdminCreateUserOnly": true
20+
},
21+
"DeletionProtection": "INACTIVE",
22+
"EmailVerificationMessage": "The verification code to your new account is {####}",
23+
"EmailVerificationSubject": "Verify your new account",
24+
"Policies": {
25+
"SignInPolicy": {
26+
"AllowedFirstAuthFactors": [
27+
"PASSWORD",
28+
"EMAIL_OTP",
29+
"WEB_AUTHN"
30+
]
31+
}
32+
},
33+
"SmsVerificationMessage": "The verification code to your new account is {####}",
34+
"VerificationMessageTemplate": {
35+
"DefaultEmailOption": "CONFIRM_WITH_CODE",
36+
"EmailMessage": "The verification code to your new account is {####}",
37+
"EmailSubject": "Verify your new account",
38+
"SmsMessage": "The verification code to your new account is {####}"
39+
},
40+
"WebAuthnRelyingPartyID": "example.com",
41+
"WebAuthnUserVerification": "required"
42+
},
43+
"UpdateReplacePolicy": "Delete",
44+
"DeletionPolicy": "Delete"
45+
},
46+
"myuserpooldisabledpasswordless25B4C801": {
47+
"Type": "AWS::Cognito::UserPool",
48+
"Properties": {
49+
"AccountRecoverySetting": {
50+
"RecoveryMechanisms": [
51+
{
52+
"Name": "verified_phone_number",
53+
"Priority": 1
54+
},
55+
{
56+
"Name": "verified_email",
57+
"Priority": 2
58+
}
59+
]
60+
},
61+
"AdminCreateUserConfig": {
62+
"AllowAdminCreateUserOnly": true
63+
},
64+
"DeletionProtection": "INACTIVE",
65+
"EmailVerificationMessage": "The verification code to your new account is {####}",
66+
"EmailVerificationSubject": "Verify your new account",
67+
"Policies": {
68+
"SignInPolicy": {
69+
"AllowedFirstAuthFactors": [
70+
"PASSWORD"
71+
]
72+
}
73+
},
74+
"SmsVerificationMessage": "The verification code to your new account is {####}",
75+
"UserPoolTier": "LITE",
76+
"VerificationMessageTemplate": {
77+
"DefaultEmailOption": "CONFIRM_WITH_CODE",
78+
"EmailMessage": "The verification code to your new account is {####}",
79+
"EmailSubject": "Verify your new account",
80+
"SmsMessage": "The verification code to your new account is {####}"
81+
}
82+
},
83+
"UpdateReplacePolicy": "Delete",
84+
"DeletionPolicy": "Delete"
85+
}
86+
},
87+
"Outputs": {
88+
"userpoolpasswordless": {
89+
"Value": {
90+
"Ref": "myuserpool01998219"
91+
}
92+
}
93+
},
94+
"Parameters": {
95+
"BootstrapVersion": {
96+
"Type": "AWS::SSM::Parameter::Value<String>",
97+
"Default": "/cdk-bootstrap/hnb659fds/version",
98+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
99+
}
100+
},
101+
"Rules": {
102+
"CheckBootstrapVersion": {
103+
"Assertions": [
104+
{
105+
"Assert": {
106+
"Fn::Not": [
107+
{
108+
"Fn::Contains": [
109+
[
110+
"1",
111+
"2",
112+
"3",
113+
"4",
114+
"5"
115+
],
116+
{
117+
"Ref": "BootstrapVersion"
118+
}
119+
]
120+
}
121+
]
122+
},
123+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
124+
}
125+
]
126+
}
127+
}
128+
}

packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-passwordless.js.snapshot/integ.json

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-passwordless.js.snapshot/manifest.json

+125
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)