I am trying to code my cognito userpools as cloudformation templates. I am running into one open question however: how to define standard attributes? Will Cognito know that birthdate in Schema is meant to be the standard birthdate - and validate it as such? How is the attribute Schema defined in the cloudformation template mapped to the standard, non-custom attributes like email, birthdate, ...?
More details: AWS Cognito separates between standard attributes and custom attributes. This separation is amongst other things important because standard attributes are validated for their format: email and birthdate for example accept only an AWS defined, specific format.
Thus my question: how does AWS Cognito map the cloudformation Schema defined attributes to standard AWS Cognito attributes? Does it at all, and if so by identity of the attribute name?
Also see:
AWS Cognito Cloudformation Schema
Example created by someone: Cloudformation example
You need to use the SchemaAttributes property. For standard attributes they must be named according to the Open ID Connect specification -
http://openid.net/specs/openid-connect-core-1_0.html#StandardClaims
http://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html
By doing this they will map appropriately and you can set other properties on the property such as Required. It appears the docs need to be updated to make this more clear.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cognito-userpool-schemaattribute.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With