# ProviderAttribute

An attribute available from a third party identity provider.

Obtainable from: ProviderAttribute.AMAZON_EMAIL, ProviderAttribute.AMAZON_NAME, ProviderAttribute.AMAZON_POSTAL_CODE, ProviderAttribute.AMAZON_USER_ID, ProviderAttribute.APPLE_EMAIL, ProviderAttribute.APPLE_EMAIL_VERIFIED, ProviderAttribute.APPLE_FIRST_NAME, ProviderAttribute.APPLE_LAST_NAME, ProviderAttribute.APPLE_NAME, ProviderAttribute.FACEBOOK_BIRTHDAY, ProviderAttribute.FACEBOOK_EMAIL, ProviderAttribute.FACEBOOK_FIRST_NAME, ProviderAttribute.FACEBOOK_GENDER, ProviderAttribute.FACEBOOK_ID, ProviderAttribute.FACEBOOK_LAST_NAME, ProviderAttribute.FACEBOOK_LOCALE, ProviderAttribute.FACEBOOK_MIDDLE_NAME, ProviderAttribute.FACEBOOK_NAME, ProviderAttribute.GOOGLE_BIRTHDAYS, ProviderAttribute.GOOGLE_EMAIL, ProviderAttribute.GOOGLE_EMAIL_VERIFIED, ProviderAttribute.GOOGLE_FAMILY_NAME, ProviderAttribute.GOOGLE_GENDER, ProviderAttribute.GOOGLE_GIVEN_NAME, ProviderAttribute.GOOGLE_NAME, ProviderAttribute.GOOGLE_NAMES, ProviderAttribute.GOOGLE_PHONE_NUMBERS, ProviderAttribute.GOOGLE_PICTURE, ProviderAttribute.other

- Source: [`aws-cognito/lib/user-pool-idps/base.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-cognito/lib/user-pool-idps/base.ts#L6)
- Type last changed: v2.163.0 · 22 Oct 2024

## Example

TypeScript:

```ts
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,
    },
  },
});
```

Python:

```python
userpool = cognito.UserPool(self, "Pool")

cognito.UserPoolIdentityProviderAmazon(self, "Amazon",
    client_id="amzn-client-id",
    client_secret="amzn-client-secret",
    user_pool=userpool,
    attribute_mapping=cognito.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
            "unique_id": cognito.ProviderAttribute.AMAZON_USER_ID
        }
    )
)
```

Java:

```java
UserPool userpool = new UserPool(this, "Pool");

UserPoolIdentityProviderAmazon.Builder.create(this, "Amazon")
        .clientId("amzn-client-id")
        .clientSecret("amzn-client-secret")
        .userPool(userpool)
        .attributeMapping(AttributeMapping.builder()
                .email(ProviderAttribute.AMAZON_EMAIL)
                .website(ProviderAttribute.other("url")) // use other() when an attribute is not pre-defined in the CDK
                .custom(Map.of(
                        // custom user pool attributes go here
                        "uniqueId", ProviderAttribute.AMAZON_USER_ID))
                .build())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
var userpool = new UserPool(this, "Pool");

new UserPoolIdentityProviderAmazon(this, "Amazon", new UserPoolIdentityProviderAmazonProps {
    ClientId = "amzn-client-id",
    ClientSecret = "amzn-client-secret",
    UserPool = userpool,
    AttributeMapping = new AttributeMapping {
        Email = ProviderAttribute.AMAZON_EMAIL,
        Website = ProviderAttribute.Other("url"),  // use other() when an attribute is not pre-defined in the CDK
        Custom = new Dictionary<string, ProviderAttribute> {
            // custom user pool attributes go here
            { "uniqueId", ProviderAttribute.AMAZON_USER_ID }
        }
    }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
userpool := cognito.NewUserPool(this, jsii.String("Pool"))

cognito.NewUserPoolIdentityProviderAmazon(this, jsii.String("Amazon"), &UserPoolIdentityProviderAmazonProps{
	ClientId: jsii.String("amzn-client-id"),
	ClientSecret: jsii.String("amzn-client-secret"),
	UserPool: userpool,
	AttributeMapping: &AttributeMapping{
		Email: cognito.ProviderAttribute_AMAZON_EMAIL(),
		Website: cognito.ProviderAttribute_Other(jsii.String("url")),
		 // use other() when an attribute is not pre-defined in the CDK
		Custom: map[string]ProviderAttribute{
			// custom user pool attributes go here
			"uniqueId": cognito.ProviderAttribute_AMAZON_USER_ID(),
		},
	},
})
```

## Properties

- `AMAZON_EMAIL`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The email attribute provided by Amazon.

- `AMAZON_NAME`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The name attribute provided by Amazon.

- `AMAZON_POSTAL_CODE`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The postal code attribute provided by Amazon.

- `AMAZON_USER_ID`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The user id attribute provided by Amazon.

- `APPLE_EMAIL`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The email attribute provided by Apple.

- `APPLE_EMAIL_VERIFIED`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The email verified attribute provided by Apple.

- `APPLE_FIRST_NAME`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The first name attribute provided by Apple.

- `APPLE_LAST_NAME`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The last name attribute provided by Apple.

- `APPLE_NAME`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The name attribute provided by Apple.

- `attributeName`: string — The attribute value string as recognized by the provider.

- `FACEBOOK_BIRTHDAY`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The birthday attribute provided by Facebook.

- `FACEBOOK_EMAIL`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The email attribute provided by Facebook.

- `FACEBOOK_FIRST_NAME`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The first name attribute provided by Facebook.

- `FACEBOOK_GENDER`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The gender attribute provided by Facebook.

- `FACEBOOK_ID`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The user id attribute provided by Facebook.

- `FACEBOOK_LAST_NAME`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The last name attribute provided by Facebook.

- `FACEBOOK_LOCALE`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The locale attribute provided by Facebook.

- `FACEBOOK_MIDDLE_NAME`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The middle name attribute provided by Facebook.

- `FACEBOOK_NAME`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The name attribute provided by Facebook.

- `GOOGLE_BIRTHDAYS`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The birthday attribute provided by Google.

- `GOOGLE_EMAIL`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The email attribute provided by Google.

- `GOOGLE_EMAIL_VERIFIED`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The email verified attribute provided by Google.

- `GOOGLE_FAMILY_NAME`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The family name attribute provided by Google.

- `GOOGLE_GENDER`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The gender attribute provided by Google.

- `GOOGLE_GIVEN_NAME`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The given name attribute provided by Google.

- `GOOGLE_NAME`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The name attribute provided by Google.

- `GOOGLE_NAMES`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The name attribute provided by Google.

- `GOOGLE_PHONE_NUMBERS`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The phone number attribute provided by Google.

- `GOOGLE_PICTURE`: [ProviderAttribute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.ProviderAttribute.html) (static) — The picture attribute provided by Google.

## Methods

- `other(attributeName: string): ProviderAttribute // chainable` (static) — Use this to specify an attribute from the identity provider that is not pre-defined in the CDK.

  **Parameters**

  - `attributeName` — the attribute value string as recognized by the provider.
