Skip to content

Commit 375f1a6

Browse files
feat(cognito): support provider details for UserPoolIdentityProviderSaml (#29588)
### Issue # (if applicable) Closes #29494. Closes #29598. #29598 is really close issue and I tried to resolve it in this PR. If it is not good to resolve multiple issues in 1 PR, I would separate this PR. ### Reason for this change [`UserPoolIdentityProviderSaml` can configure `ProviderDetails`](https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpoolidentityprovider.html#aws-resource-cognito-userpoolidentityprovider-properties) but there are some items that is not configurable from AWS CDK. - `EncryptedResponses` - `RequestSigningAlgorithm` - `IDPInit` ### Description of changes Add 3 properties to `UserPoolIdentityProviderSamlProps`. - `encryptedResponses` - `requestSigningAlgorithm` - `idpInitiated` ### Description of how you validated changes Added both unit 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 48731ad commit 375f1a6

File tree

11 files changed

+472
-62
lines changed

11 files changed

+472
-62
lines changed

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

+1-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-idp.saml.js.snapshot/integ-user-pool-identity-provider-saml-stack.assets.json

+3-3
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-idp.saml.js.snapshot/integ-user-pool-identity-provider-saml-stack.template.json

+84-8
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
"poolclient2623294C": {
3535
"Type": "AWS::Cognito::UserPoolClient",
3636
"Properties": {
37-
"UserPoolId": {
38-
"Ref": "pool056F3F7E"
39-
},
4037
"AllowedOAuthFlows": [
4138
"implicit",
4239
"code"
@@ -54,10 +51,13 @@
5451
],
5552
"SupportedIdentityProviders": [
5653
{
57-
"Ref": "cdk52888317"
54+
"Ref": "samlProvider6C4CC492"
5855
},
5956
"COGNITO"
60-
]
57+
],
58+
"UserPoolId": {
59+
"Ref": "pool056F3F7E"
60+
}
6161
}
6262
},
6363
"pooldomain430FA744": {
@@ -69,17 +69,93 @@
6969
}
7070
}
7171
},
72-
"cdk52888317": {
72+
"samlProvider6C4CC492": {
7373
"Type": "AWS::Cognito::UserPoolIdentityProvider",
7474
"Properties": {
75-
"ProviderName": "cdk",
75+
"ProviderDetails": {
76+
"IDPSignout": false,
77+
"MetadataURL": "https://fujifish.github.io/samling/public/metadata.xml",
78+
"EncryptedResponses": true,
79+
"RequestSigningAlgorithm": "rsa-sha256"
80+
},
81+
"ProviderName": "provider",
7682
"ProviderType": "SAML",
7783
"UserPoolId": {
7884
"Ref": "pool056F3F7E"
85+
}
86+
}
87+
},
88+
"poolForIdpInitiatedSaml8B7CB492": {
89+
"Type": "AWS::Cognito::UserPool",
90+
"Properties": {
91+
"AccountRecoverySetting": {
92+
"RecoveryMechanisms": [
93+
{
94+
"Name": "verified_phone_number",
95+
"Priority": 1
96+
},
97+
{
98+
"Name": "verified_email",
99+
"Priority": 2
100+
}
101+
]
79102
},
103+
"AdminCreateUserConfig": {
104+
"AllowAdminCreateUserOnly": true
105+
},
106+
"EmailVerificationMessage": "The verification code to your new account is {####}",
107+
"EmailVerificationSubject": "Verify your new account",
108+
"SmsVerificationMessage": "The verification code to your new account is {####}",
109+
"VerificationMessageTemplate": {
110+
"DefaultEmailOption": "CONFIRM_WITH_CODE",
111+
"EmailMessage": "The verification code to your new account is {####}",
112+
"EmailSubject": "Verify your new account",
113+
"SmsMessage": "The verification code to your new account is {####}"
114+
}
115+
},
116+
"UpdateReplacePolicy": "Delete",
117+
"DeletionPolicy": "Delete"
118+
},
119+
"poolForIdpInitiatedSamlidpInitiatedClientACB7B7B4": {
120+
"Type": "AWS::Cognito::UserPoolClient",
121+
"Properties": {
122+
"AllowedOAuthFlows": [
123+
"implicit",
124+
"code"
125+
],
126+
"AllowedOAuthFlowsUserPoolClient": true,
127+
"AllowedOAuthScopes": [
128+
"profile",
129+
"phone",
130+
"email",
131+
"openid",
132+
"aws.cognito.signin.user.admin"
133+
],
134+
"CallbackURLs": [
135+
"https://example.com"
136+
],
137+
"SupportedIdentityProviders": [
138+
{
139+
"Ref": "samlProviderIdpInitiatedA5C8CB58"
140+
}
141+
],
142+
"UserPoolId": {
143+
"Ref": "poolForIdpInitiatedSaml8B7CB492"
144+
}
145+
}
146+
},
147+
"samlProviderIdpInitiatedA5C8CB58": {
148+
"Type": "AWS::Cognito::UserPoolIdentityProvider",
149+
"Properties": {
80150
"ProviderDetails": {
81151
"IDPSignout": false,
82-
"MetadataURL": "https://fujifish.github.io/samling/public/metadata.xml"
152+
"MetadataURL": "https://fujifish.github.io/samling/public/metadata.xml",
153+
"IDPInit": true
154+
},
155+
"ProviderName": "IdPInitiatedProvider",
156+
"ProviderType": "SAML",
157+
"UserPoolId": {
158+
"Ref": "poolForIdpInitiatedSaml8B7CB492"
83159
}
84160
}
85161
}

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

+1-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-idp.saml.js.snapshot/integuserpoolidentityprovidersamltestDefaultTestDeployAssert97F09C26.assets.json

+1-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-idp.saml.js.snapshot/manifest.json

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

0 commit comments

Comments
 (0)