简体   繁体   中英

AWS Cognito Userpool via cloudformation file

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM