Skip to content

Issue with Map types in CognitoUserPoolPreTokenGenerationEventV2 -> GroupOverrideDetails #516

New issue

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

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

Already on GitHub? Sign in to your account

Open
torbjokv opened this issue Dec 9, 2024 · 1 comment

Comments

@torbjokv
Copy link

torbjokv commented Dec 9, 2024

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!

@lachlanodonnell
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants