Open jbhammon opened 2 years ago
@jbhammon it looks like this may be because you are specifying a required mutable standard attribute when creating the user pool, but it isn't included in the client write attributes. Can you try
const clientWriteAttributes = new cognito.ClientAttributes().withCustomAttributes("existsInDjango").withStandardAttributes({ email: true });
Ah, thanks, seems like that did the trick.
I'll like to propose a change to the cdk docs to make note of this:
specifying a required mutable standard attribute when creating the user pool
Should I open a new issue to track that, or make note of it here somehow?
@jbhammon we can use this issue to track the docs fix. If you'd like to see this fixed soon I recommend checking out our contributing guide and opening a PR!
Awesome, will do soon, thanks!
In case this helps anyone, I had a custom attribute "name". I didn't notice it already existed in the standard cognito attributes (I thought it only used givenName and familyName). This error message could be more helpful if it included which attribute is the one causing the issue.
From cognito docs :
In the app client settings for your application, the mapped attributes [from the user-pool] must be writable.
@jbhammon 's issue was resolved not because his mapped email
attribute was required & mutable, but simply because it existed in the pool's standard attributes, and was not specified as writable in his client config.
You could also see this when navigating Attribute read and write permissions in the AWS console, and looking at the disabled checkboxes : enabled & disabled checkboxes in the write column should relate to mapped standard attributes from the user-pool.
Hope it helps :pray:
Describe the bug
Creating a writeable custom attribute on a User Pool Client results in an error when deploying.
Expected Behavior
Custom attributes are able to be made writeable in User Pool Clients just like standard attributes are.
Current Behavior
Error output from
deploy
command:Reproduction Steps
Create an instance of this class as part of a
Stack
Possible Solution
No response
Additional Information/Context
The User Pool is being created no problem, the issues arises from trying to make the
existsInDjango
custom attribute writeable. Stack deploys just fine when that line is not included.CDK CLI Version
2.28.0
Framework Version
aws-cdk@2.28.0
Node.js Version
16.13.1
OS
macOS 12.4
Language
Typescript
Language Version
typescript@3.9.10
Other information
No response