@smither/aws-user-pool-client-settings

aws-cdk custom resource to allow setting details for user pool client and integrations.

Usage no npm install needed!

<script type="module">
  import smitherAwsUserPoolClientSettings from 'https://cdn.skypack.dev/@smither/aws-user-pool-client-settings';
</script>

README

I have simply converted an already existing lambda/cloudformation solution into an easier to use format for aws-cdk users. The actual lambda code is taken from https://github.com/rosberglinhares/CloudFormationCognitoCustomResources

If you want any additional features just open an issue, or better yet a merge request.

Usage

Usage if fairly self explanatory, but if you're unsure then here is an example: The userPool and userPoolClient objects are @aws-cdk/aws-cognito objects that should already be in your stack.

let userPoolClientSettings = new UserPoolClientSettings(
    this,
    `userPoolClientSettings`,
    {
    domain: `domain.example.com`,
    userPool: userPool,
    userPoolClient: userPoolClient,
    supportedIdentityProviders: [IdentityProviders.COGNITO],
    callbackURLs: [`https://${cloudFront.domainName}`],
    logoutURLs: [`https://${cloudFront.domainName}`],
    allowedOAuthFlowsUserPoolClient: true,
    allowedOAuthFlows: ["code", "implicit"],
    allowedOAuthScopes: ["openid", "email", "aws.cognito.signin.user.admin"]
    }
);