How to create Cognito IdentityPool with Cognito UserPool as one of the Authentication provider using aws cdk?

前端 未结 3 997
猫巷女王i
猫巷女王i 2021-02-15 17:39

I am trying to create a Cognito FederatedIdentityPool with CognitoUserPool as one Authentication Provider. Creating UserPool was easy enough:



        
3条回答
  •  花落未央
    2021-02-15 18:01

    The CDK must have changed this was created. I got it working with the example from @CCarlos:

    const pool = new cognito.CfnUserPool(this, "cdkUserpool", {
      userPoolName: "cdkUserPoolName",
      usernameAttributes: ["email"],
    });
    const client = new cognito.CfnUserPoolClient(this, "cdkClient", {
      userPoolId: pool.ref, // <--- This part has changed.
      explicitAuthFlows: ["ADMIN_NO_SRP_AUTH"],
      generateSecret: false,
      readAttributes: [
        "preferred_username",
        "website",
        "email",
        "name",
        "zoneinfo",
        "phone_number",
        "phone_number_verified",
        "email_verified",
      ],
      writeAttributes: ["name", "zoneinfo", "phone_number"],
    });
    

提交回复
热议问题