Skip to content

Issue with Map types in CognitoUserPoolPreTokenGenerationEventV2 -> GroupOverrideDetails  #516

Open

Description

@torbjokv

According to my support representative and the documentation https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-token-generation.html#aws-lambda-triggers-pre-token-generation-example-version-2-overview, the response should return list types for groupsToOverride and iamRolesToOverride even when I use V2 pre token generation, not Map<String, String>. My experiences with Map<String, String> here is that cognito fails when I return an object generated by the current java sdk with map here instead of a list, so I suspect that the SDK uses the wrong types here. Thank you in advance for looking into my issue!

Activity

  1. lachlanodonnell commented on Jan 28, 2025

    @lachlanodonnell

    I found this out the hard way - after spending a couple of hours I eventually use Jackson to convert the input CognitoUserPoolPreTokenGenerationEventV2 object to a Map and manually set the List for response group override. Please update the Java objects for CognitoUserPoolPreTokenGenerationEventV2.GroupOverrideDetails as they should be Lists, not Maps.

    Found on 3.14.0 (maven central).

  2. smirnoal commented on Mar 19, 2026

    @smirnoal
    Contributor

    hey folks, were you able to verify the fix? can the issue be closed now?

  3. lachlanodonnell commented on Mar 20, 2026

    @lachlanodonnell

    This is no longer an issue for me since a SDK2 update (last year).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions