Skip to content

Commit 9a75407

Browse files
authored
feat(cognito): add identity pool authentication provider support (#338)
Enable adding Cognito User Pool authentication to an Identity Pool by introducing a method to add a User Pool authentication provider when an Identity Pool is configured.
1 parent cc8d36d commit 9a75407

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/constructs/authentication.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,16 @@ export class CognitoAuthentication extends Construct implements ICognitoAuthenti
362362
key: `${CFN_OUTPUT_SUFFIX_AUTH_USERPOOL_CLIENTID}${id}`,
363363
value: client.userPoolClientId,
364364
});
365+
366+
if (this.identityPool) {
367+
this.identityPool.addUserPoolAuthentication(
368+
new identitypool.UserPoolAuthenticationProvider({
369+
userPool: this.userpool,
370+
userPoolClient: client,
371+
}),
372+
);
373+
}
374+
365375
return client;
366376
}
367377

0 commit comments

Comments
 (0)