Skip to content

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

@mirkods

Description

@mirkods

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 signup 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-cognitoRelated to Amazon CognitobugThis issue is a bug.effort/mediumMedium work item – several days of effortp2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions