ProviderAttribute Class
An attribute available from a third party identity provider.
| Source | aws-cognito/lib/user-pool-idps/base.ts |
|---|---|
| Type last changed |
Example
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
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
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();
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 }
}
}
});
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_EMAILProviderAttributeAMAZON_EMAILProviderAttributeAMAZON_EMAILProviderAttributeAMAZON_EMAILProviderAttributeAMAZON_EMAILProviderAttribute static #The email attribute provided by Amazon.
AMAZON_NAMEProviderAttributeAMAZON_NAMEProviderAttributeAMAZON_NAMEProviderAttributeAMAZON_NAMEProviderAttributeAMAZON_NAMEProviderAttribute static #The name attribute provided by Amazon.
AMAZON_POSTAL_CODEProviderAttributeAMAZON_POSTAL_CODEProviderAttributeAMAZON_POSTAL_CODEProviderAttributeAMAZON_POSTAL_CODEProviderAttributeAMAZON_POSTAL_CODEProviderAttribute static #The postal code attribute provided by Amazon.
AMAZON_USER_IDProviderAttributeAMAZON_USER_IDProviderAttributeAMAZON_USER_IDProviderAttributeAMAZON_USER_IDProviderAttributeAMAZON_USER_IDProviderAttribute static #The user id attribute provided by Amazon.
APPLE_EMAILProviderAttributeAPPLE_EMAILProviderAttributeAPPLE_EMAILProviderAttributeAPPLE_EMAILProviderAttributeAPPLE_EMAILProviderAttribute static #The email attribute provided by Apple.
APPLE_EMAIL_VERIFIEDProviderAttributeAPPLE_EMAIL_VERIFIEDProviderAttributeAPPLE_EMAIL_VERIFIEDProviderAttributeAPPLE_EMAIL_VERIFIEDProviderAttributeAPPLE_EMAIL_VERIFIEDProviderAttribute static #The email verified attribute provided by Apple.
APPLE_FIRST_NAMEProviderAttributeAPPLE_FIRST_NAMEProviderAttributeAPPLE_FIRST_NAMEProviderAttributeAPPLE_FIRST_NAMEProviderAttributeAPPLE_FIRST_NAMEProviderAttribute static #The first name attribute provided by Apple.
APPLE_LAST_NAMEProviderAttributeAPPLE_LAST_NAMEProviderAttributeAPPLE_LAST_NAMEProviderAttributeAPPLE_LAST_NAMEProviderAttributeAPPLE_LAST_NAMEProviderAttribute static #The last name attribute provided by Apple.
APPLE_NAMEProviderAttributeAPPLE_NAMEProviderAttributeAPPLE_NAMEProviderAttributeAPPLE_NAMEProviderAttributeAPPLE_NAMEProviderAttribute static #The name attribute provided by Apple.
The attribute value string as recognized by the provider.
FACEBOOK_BIRTHDAYProviderAttributeFACEBOOK_BIRTHDAYProviderAttributeFACEBOOK_BIRTHDAYProviderAttributeFACEBOOK_BIRTHDAYProviderAttributeFACEBOOK_BIRTHDAYProviderAttribute static #The birthday attribute provided by Facebook.
FACEBOOK_EMAILProviderAttributeFACEBOOK_EMAILProviderAttributeFACEBOOK_EMAILProviderAttributeFACEBOOK_EMAILProviderAttributeFACEBOOK_EMAILProviderAttribute static #The email attribute provided by Facebook.
FACEBOOK_FIRST_NAMEProviderAttributeFACEBOOK_FIRST_NAMEProviderAttributeFACEBOOK_FIRST_NAMEProviderAttributeFACEBOOK_FIRST_NAMEProviderAttributeFACEBOOK_FIRST_NAMEProviderAttribute static #The first name attribute provided by Facebook.
FACEBOOK_GENDERProviderAttributeFACEBOOK_GENDERProviderAttributeFACEBOOK_GENDERProviderAttributeFACEBOOK_GENDERProviderAttributeFACEBOOK_GENDERProviderAttribute static #The gender attribute provided by Facebook.
FACEBOOK_IDProviderAttributeFACEBOOK_IDProviderAttributeFACEBOOK_IDProviderAttributeFACEBOOK_IDProviderAttributeFACEBOOK_IDProviderAttribute static #The user id attribute provided by Facebook.
FACEBOOK_LAST_NAMEProviderAttributeFACEBOOK_LAST_NAMEProviderAttributeFACEBOOK_LAST_NAMEProviderAttributeFACEBOOK_LAST_NAMEProviderAttributeFACEBOOK_LAST_NAMEProviderAttribute static #The last name attribute provided by Facebook.
FACEBOOK_LOCALEProviderAttributeFACEBOOK_LOCALEProviderAttributeFACEBOOK_LOCALEProviderAttributeFACEBOOK_LOCALEProviderAttributeFACEBOOK_LOCALEProviderAttribute static #The locale attribute provided by Facebook.
FACEBOOK_MIDDLE_NAMEProviderAttributeFACEBOOK_MIDDLE_NAMEProviderAttributeFACEBOOK_MIDDLE_NAMEProviderAttributeFACEBOOK_MIDDLE_NAMEProviderAttributeFACEBOOK_MIDDLE_NAMEProviderAttribute static #The middle name attribute provided by Facebook.
FACEBOOK_NAMEProviderAttributeFACEBOOK_NAMEProviderAttributeFACEBOOK_NAMEProviderAttributeFACEBOOK_NAMEProviderAttributeFACEBOOK_NAMEProviderAttribute static #The name attribute provided by Facebook.
GOOGLE_BIRTHDAYSProviderAttributeGOOGLE_BIRTHDAYSProviderAttributeGOOGLE_BIRTHDAYSProviderAttributeGOOGLE_BIRTHDAYSProviderAttributeGOOGLE_BIRTHDAYSProviderAttribute static #The birthday attribute provided by Google.
GOOGLE_EMAILProviderAttributeGOOGLE_EMAILProviderAttributeGOOGLE_EMAILProviderAttributeGOOGLE_EMAILProviderAttributeGOOGLE_EMAILProviderAttribute static #The email attribute provided by Google.
GOOGLE_EMAIL_VERIFIEDProviderAttributeGOOGLE_EMAIL_VERIFIEDProviderAttributeGOOGLE_EMAIL_VERIFIEDProviderAttributeGOOGLE_EMAIL_VERIFIEDProviderAttributeGOOGLE_EMAIL_VERIFIEDProviderAttribute static #The email verified attribute provided by Google.
GOOGLE_FAMILY_NAMEProviderAttributeGOOGLE_FAMILY_NAMEProviderAttributeGOOGLE_FAMILY_NAMEProviderAttributeGOOGLE_FAMILY_NAMEProviderAttributeGOOGLE_FAMILY_NAMEProviderAttribute static #The family name attribute provided by Google.
GOOGLE_GENDERProviderAttributeGOOGLE_GENDERProviderAttributeGOOGLE_GENDERProviderAttributeGOOGLE_GENDERProviderAttributeGOOGLE_GENDERProviderAttribute static #The gender attribute provided by Google.
GOOGLE_GIVEN_NAMEProviderAttributeGOOGLE_GIVEN_NAMEProviderAttributeGOOGLE_GIVEN_NAMEProviderAttributeGOOGLE_GIVEN_NAMEProviderAttributeGOOGLE_GIVEN_NAMEProviderAttribute static #The given name attribute provided by Google.
GOOGLE_NAMEProviderAttributeGOOGLE_NAMEProviderAttributeGOOGLE_NAMEProviderAttributeGOOGLE_NAMEProviderAttributeGOOGLE_NAMEProviderAttribute static #The name attribute provided by Google.
GOOGLE_NAMESProviderAttributeGOOGLE_NAMESProviderAttributeGOOGLE_NAMESProviderAttributeGOOGLE_NAMESProviderAttributeGOOGLE_NAMESProviderAttribute static #The name attribute provided by Google.
GOOGLE_PHONE_NUMBERSProviderAttributeGOOGLE_PHONE_NUMBERSProviderAttributeGOOGLE_PHONE_NUMBERSProviderAttributeGOOGLE_PHONE_NUMBERSProviderAttributeGOOGLE_PHONE_NUMBERSProviderAttribute static #The phone number attribute provided by Google.
GOOGLE_PICTUREProviderAttributeGOOGLE_PICTUREProviderAttributeGOOGLE_PICTUREProviderAttributeGOOGLE_PICTUREProviderAttributeGOOGLE_PICTUREProviderAttribute static #The picture attribute provided by Google.
Methods
other(attributeName: string): ProviderAttribute // chainable@staticmethod def other(attribute_name: str) -> ProviderAttributepublic static ProviderAttribute other(String attributeName)public static ProviderAttribute Other(string attributeName)func Other(AttributeName *string) ProviderAttribute static #Use this to specify an attribute from the identity provider that is not pre-defined in the CDK.
1 parameter
Parameters
attributeNameattribute_nameattributeNameattributeNameAttributeName— the attribute value string as recognized by the provider.