Class StandardAttribute
Standard attribute that can be marked as required or mutable.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.Cognito
Assembly: Amazon.CDK.AWS.Cognito.dll
Syntax (csharp)
public class StandardAttribute : Object, IStandardAttribute
Syntax (vb)
Public Class StandardAttribute
Inherits Object
Implements IStandardAttribute
Remarks
ExampleMetadata: infused
Examples
new UserPool(this, "myuserpool", new UserPoolProps {
// ...
StandardAttributes = new StandardAttributes {
Fullname = new StandardAttribute {
Required = true,
Mutable = false
},
Address = new StandardAttribute {
Required = false,
Mutable = true
}
},
CustomAttributes = new Dictionary<string, ICustomAttribute> {
{ "myappid", new StringAttribute(new StringAttributeProps { MinLen = 5, MaxLen = 15, Mutable = false }) },
{ "callingcode", new NumberAttribute(new NumberAttributeProps { Min = 1, Max = 3, Mutable = true }) },
{ "isEmployee", new BooleanAttribute(new CustomAttributeProps { Mutable = true }) },
{ "joinedOn", new DateTimeAttribute() }
}
});
Synopsis
Constructors
StandardAttribute() |
Properties
Mutable | Specifies whether the value of the attribute can be changed. |
Required | Specifies whether the attribute is required upon user registration. |
Constructors
StandardAttribute()
public StandardAttribute()
Properties
Mutable
Specifies whether the value of the attribute can be changed.
public Nullable<bool> Mutable { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
For any user pool attribute that's mapped to an identity provider attribute, this must be set to true
.
Amazon Cognito updates mapped attributes when users sign in to your application through an identity provider.
If an attribute is immutable, Amazon Cognito throws an error when it attempts to update the attribute.
Default: true
Required
Specifies whether the attribute is required upon user registration.
public Nullable<bool> Required { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
If the attribute is required and the user does not provide a value, registration or sign-in will fail.
Default: false