Skip to content

Commit f2c5f68

Browse files
authored
feat(cognito): add defaultRedirectUri to UserPoolClient (#30481)
### Issue # (if applicable) N/A ### Reason for this change The `defaulrRedirectUri` property missing in the current `UserPoolClient` class, The DefaultRedirectURI setting is essential when using Amazon Cognito Hosted UI because it specifies the primary destination where users will be redirected after successful authentication, ensuring a seamless and secure OAuth 2.0 or OpenID Connect flow. ### Description of changes Add missing property. ### Description of how you validated changes Add unit tests and integ tests. ### 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 1bacb69 commit f2c5f68

12 files changed

+623
-1
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-client-default-redirect-uri.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-client-default-redirect-uri.js.snapshot/integ-user-pool-client-default-redirect-uri.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,98 @@
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+
"EmailVerificationMessage": "The verification code to your new account is {####}",
22+
"EmailVerificationSubject": "Verify your new account",
23+
"SmsVerificationMessage": "The verification code to your new account is {####}",
24+
"VerificationMessageTemplate": {
25+
"DefaultEmailOption": "CONFIRM_WITH_CODE",
26+
"EmailMessage": "The verification code to your new account is {####}",
27+
"EmailSubject": "Verify your new account",
28+
"SmsMessage": "The verification code to your new account is {####}"
29+
}
30+
},
31+
"UpdateReplacePolicy": "Delete",
32+
"DeletionPolicy": "Delete"
33+
},
34+
"myuserpoolmyuserpoolclientAFB2274E": {
35+
"Type": "AWS::Cognito::UserPoolClient",
36+
"Properties": {
37+
"AllowedOAuthFlows": [
38+
"implicit",
39+
"code"
40+
],
41+
"AllowedOAuthFlowsUserPoolClient": true,
42+
"AllowedOAuthScopes": [
43+
"profile",
44+
"phone",
45+
"email",
46+
"openid",
47+
"aws.cognito.signin.user.admin"
48+
],
49+
"CallbackURLs": [
50+
"https://aaa.example.com",
51+
"https://bbb.example.com",
52+
"https://ccc.example.com"
53+
],
54+
"DefaultRedirectURI": "https://aaa.example.com",
55+
"SupportedIdentityProviders": [
56+
"COGNITO"
57+
],
58+
"UserPoolId": {
59+
"Ref": "myuserpool01998219"
60+
}
61+
}
62+
}
63+
},
64+
"Parameters": {
65+
"BootstrapVersion": {
66+
"Type": "AWS::SSM::Parameter::Value<String>",
67+
"Default": "/cdk-bootstrap/hnb659fds/version",
68+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
69+
}
70+
},
71+
"Rules": {
72+
"CheckBootstrapVersion": {
73+
"Assertions": [
74+
{
75+
"Assert": {
76+
"Fn::Not": [
77+
{
78+
"Fn::Contains": [
79+
[
80+
"1",
81+
"2",
82+
"3",
83+
"4",
84+
"5"
85+
],
86+
{
87+
"Ref": "BootstrapVersion"
88+
}
89+
]
90+
}
91+
]
92+
},
93+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
94+
}
95+
]
96+
}
97+
}
98+
}

packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-client-default-redirect-uri.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-client-default-redirect-uri.js.snapshot/integuserpoolclientdefaultredirecturitestDefaultTestDeployAssertF79A1D23.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-client-default-redirect-uri.js.snapshot/integuserpoolclientdefaultredirecturitestDefaultTestDeployAssertF79A1D23.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-client-default-redirect-uri.js.snapshot/manifest.json

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

0 commit comments

Comments
 (0)