aws-cdk-lib.aws_cognito.AttributeMapping

interface AttributeMapping

LanguageType name
.NETAmazon.CDK.AWS.Cognito.AttributeMapping
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscognito#AttributeMapping
Javasoftware.amazon.awscdk.services.cognito.AttributeMapping
Pythonaws_cdk.aws_cognito.AttributeMapping
TypeScript (source)aws-cdk-lib » aws_cognito » AttributeMapping

The mapping of user pool attributes to the attributes provided by the identity providers.

Example

const userpool = new cognito.UserPool(this, 'Pool');

new cognito.UserPoolIdentityProviderAmazon(this, 'Amazon', {
  clientId: 'amzn-client-id',
  clientSecret: 'amzn-client-secret',
  userPool: userpool,
  attributeMapping: {
    email: cognito.ProviderAttribute.AMAZON_EMAIL,
    website: cognito.ProviderAttribute.other('url'), // use other() when an attribute is not pre-defined in the CDK
    custom: {
      // custom user pool attributes go here
      uniqueId: cognito.ProviderAttribute.AMAZON_USER_ID,
    },
  },
});

Properties

NameTypeDescription
address?ProviderAttributeThe user's postal address is a required attribute.
birthdate?ProviderAttributeThe user's birthday.
custom?{ [string]: ProviderAttribute }Specify custom attribute mapping here and mapping for any standard attributes not supported yet.
email?ProviderAttributeThe user's e-mail address.
familyName?ProviderAttributeThe surname or last name of user.
fullname?ProviderAttributeThe user's full name in displayable form.
gender?ProviderAttributeThe user's gender.
givenName?ProviderAttributeThe user's first name or give name.
lastUpdateTime?ProviderAttributeTime, the user's information was last updated.
locale?ProviderAttributeThe user's locale.
middleName?ProviderAttributeThe user's middle name.
nickname?ProviderAttributeThe user's nickname or casual name.
phoneNumber?ProviderAttributeThe user's telephone number.
preferredUsername?ProviderAttributeThe user's preferred username.
profilePage?ProviderAttributeThe URL to the user's profile page.
profilePicture?ProviderAttributeThe URL to the user's profile picture.
timezone?ProviderAttributeThe user's time zone.
website?ProviderAttributeThe URL to the user's web page or blog.

address?

Type: ProviderAttribute (optional, default: not mapped)

The user's postal address is a required attribute.


birthdate?

Type: ProviderAttribute (optional, default: not mapped)

The user's birthday.


custom?

Type: { [string]: ProviderAttribute } (optional, default: no custom attribute mapping)

Specify custom attribute mapping here and mapping for any standard attributes not supported yet.


email?

Type: ProviderAttribute (optional, default: not mapped)

The user's e-mail address.


familyName?

Type: ProviderAttribute (optional, default: not mapped)

The surname or last name of user.


fullname?

Type: ProviderAttribute (optional, default: not mapped)

The user's full name in displayable form.


gender?

Type: ProviderAttribute (optional, default: not mapped)

The user's gender.


givenName?

Type: ProviderAttribute (optional, default: not mapped)

The user's first name or give name.


lastUpdateTime?

Type: ProviderAttribute (optional, default: not mapped)

Time, the user's information was last updated.


locale?

Type: ProviderAttribute (optional, default: not mapped)

The user's locale.


middleName?

Type: ProviderAttribute (optional, default: not mapped)

The user's middle name.


nickname?

Type: ProviderAttribute (optional, default: not mapped)

The user's nickname or casual name.


phoneNumber?

Type: ProviderAttribute (optional, default: not mapped)

The user's telephone number.


preferredUsername?

Type: ProviderAttribute (optional, default: not mapped)

The user's preferred username.


profilePage?

Type: ProviderAttribute (optional, default: not mapped)

The URL to the user's profile page.


profilePicture?

Type: ProviderAttribute (optional, default: not mapped)

The URL to the user's profile picture.


timezone?

Type: ProviderAttribute (optional, default: not mapped)

The user's time zone.


website?

Type: ProviderAttribute (optional, default: not mapped)

The URL to the user's web page or blog.