Skip to content

Commit

Permalink
feat(cognito): support emailVerified for AttributeMapping interfa…
Browse files Browse the repository at this point in the history
…ce (#31632)

### Issue #30467 

Closes #30467

### Reason for this change

For custom OpenId providers, there is no way to automatically validate email upon sign-in.
Therefore, we would like to add the `email_verified` attribute to attribute mapping, but it is not present in the member  definition of `AttributeMapping` interface., so we have added it in this PR.

### Description of changes


Added `emailVerified` attribute to `AttributeMapping` interface.

### Description of how you validated changes


Added the `email_verified` assertion to both unit and integration tests.

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
yasuaki640 authored Oct 17, 2024
1 parent 34bdeca commit 5de7835
Show file tree
Hide file tree
Showing 25 changed files with 129 additions and 70 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
"poolclient2623294C": {
"Type": "AWS::Cognito::UserPoolClient",
"Properties": {
"UserPoolId": {
"Ref": "pool056F3F7E"
},
"AllowedOAuthFlows": [
"implicit",
"code"
Expand All @@ -57,7 +54,10 @@
"Ref": "apple9B5408AC"
},
"COGNITO"
]
],
"UserPoolId": {
"Ref": "pool056F3F7E"
}
}
},
"pooldomain430FA744": {
Expand All @@ -72,21 +72,22 @@
"apple9B5408AC": {
"Type": "AWS::Cognito::UserPoolIdentityProvider",
"Properties": {
"ProviderName": "SignInWithApple",
"ProviderType": "SignInWithApple",
"UserPoolId": {
"Ref": "pool056F3F7E"
},
"AttributeMapping": {
"family_name": "lastName",
"given_name": "firstName"
"given_name": "firstName",
"email_verified": "email_verified"
},
"ProviderDetails": {
"client_id": "com.amzn.cdk",
"team_id": "CDKTEAMCDK",
"key_id": "CDKKEYCDK1",
"private_key": "PRIV_KEY_CDK",
"authorize_scopes": "email name"
},
"ProviderName": "SignInWithApple",
"ProviderType": "SignInWithApple",
"UserPoolId": {
"Ref": "pool056F3F7E"
}
}
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ new UserPoolIdentityProviderApple(stack, 'apple', {
attributeMapping: {
familyName: ProviderAttribute.APPLE_LAST_NAME,
givenName: ProviderAttribute.APPLE_FIRST_NAME,
emailVerified: ProviderAttribute.APPLE_EMAIL_VERIFIED,
},
});

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"given_name": "given_name",
"family_name": "family_name",
"email": "email",
"email_verified": "email_verified",
"gender": "gender",
"names": "names"
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ new UserPoolIdentityProviderGoogle(stack, 'google', {
givenName: ProviderAttribute.GOOGLE_GIVEN_NAME,
familyName: ProviderAttribute.GOOGLE_FAMILY_NAME,
email: ProviderAttribute.GOOGLE_EMAIL,
emailVerified: ProviderAttribute.GOOGLE_EMAIL_VERIFIED,
gender: ProviderAttribute.GOOGLE_GENDER,
custom: {
names: ProviderAttribute.GOOGLE_NAMES,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5de7835

Please sign in to comment.