Skip to content

Commit 31cc5fb

Browse files
fix: add custom attribute to cognito for OIDC and SAML deployments (#673)
* fix: add custom attribute to cognito for OIDC and SAML deployments * make custom attribute optional --------- Co-authored-by: Maryam Khidir <[email protected]>
1 parent 09c965f commit 31cc5fb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/authentication/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ export class Authentication extends Construct {
2020
constructor(scope: Construct, id: string, config: SystemConfig) {
2121
super(scope, id);
2222

23+
const customAttributes = config.cognitoFederation?.enabled
24+
? { chatbot_role: new cognito.StringAttribute({ mutable: true }) }
25+
: undefined;
26+
2327
const userPool = new cognito.UserPool(this, "UserPool", {
2428
removalPolicy:
2529
config.retainOnDelete === true
@@ -34,6 +38,7 @@ export class Authentication extends Construct {
3438
signInAliases: {
3539
email: true,
3640
},
41+
...(customAttributes && { customAttributes }),
3742
});
3843

3944
new cognito.CfnUserPoolGroup(this, "AdminGroup", {

0 commit comments

Comments
 (0)