Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

aws-cognito: UserPoolIdentityProviderOidc does not support email_verified as attributeMapping #30467

Closed
mirkods opened this issue Jun 6, 2024 · 4 comments · Fixed by #31632
Closed
Labels
@aws-cdk/aws-cognito Related to Amazon Cognito bug This issue is a bug. effort/medium Medium work item – several days of effort p2

Comments

@mirkods
Copy link

mirkods commented Jun 6, 2024

Describe the bug

Hi all,

I'm configuring a custom OpenId provide on my cognito user pool. I'd like to auto_verified emails since the openId provider give me this information.

I noticed that in the AWS console I can map the email_verified field on a field that my OpenId provided provides to me but looks like that the email_verified field is not expose as a property of the construct UserPoolIdentityProviderOidc under attributeMapping key.

I expect to use this code:

new cognito.UserPoolIdentityProviderOidc(this, 'custom',{
        name: '...',
        userPool: this.userPool,
        clientId: '...',
        attributeMapping: {
          email: cognito.ProviderAttribute.other('email'),
          email_verified: cognito.ProviderAttribute.other('email_verified'),
      }
    )

Expected Behavior

I expect that using this field the email is automatically verified at the # time

Current Behavior

Actually this field is not available as property of the object attributeMapping

Reproduction Steps

Using this code:

new cognito.UserPoolIdentityProviderOidc(this, 'custom',{
        name: '...',
        userPool: this.userPool,
        clientId: '...',
        attributeMapping: {
          email: cognito.ProviderAttribute.other('email'),
          email_verified: cognito.ProviderAttribute.other('email_verified'),
      }
    )

Typescript notifies that email_verified is not a know property.

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.1628.0

Framework Version

No response

Node.js Version

18.18.2

OS

MacOs 14.5

Language

TypeScript

Language Version

No response

Other information

No response

@mirkods mirkods added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 6, 2024
@github-actions github-actions bot added the @aws-cdk/aws-cognito Related to Amazon Cognito label Jun 6, 2024
@pahud
Copy link
Contributor

pahud commented Jun 7, 2024

Looks like email_verified is not in AttributeMapping. We probably need a PR to add that. Feel free to submit a PR if you are interested.

ref: https://repost.aws/knowledge-center/cognito-email-verified-attribute

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jun 7, 2024
@mirkods
Copy link
Author

mirkods commented Jun 7, 2024

Hi @pahud,

thanks for your input. PR done 🤞🏻

Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

1 similar comment
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 17, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
@aws-cdk/aws-cognito Related to Amazon Cognito bug This issue is a bug. effort/medium Medium work item – several days of effort p2
Projects
None yet
2 participants