Invoke PreTokenGenerationLambda from Cognito with V2 Trigger

We can successfully invoke the PreTokenGenerationLambda using a V1 trigger from localstack cognito, which allows us to customise the ID token. However, we want to customise the Access token, which, according to Cognito documentation, requires us to invoke the lambda with a V2 trigger (Pre token generation Lambda trigger - Amazon Cognito).
When we create the user pool in localstack cognito, we specify the lamba arn, and the trigger type of V2, but it seems our lambda only ever gets invoked with a V1 trigger, passing a V1 event.

Does localstack support PreTokenGenerationLambdaVerstionType of V2?

1 Like

+1. I have just started using LocalStack and I was hoping to validate my Cognito use cases. Currently, it does not appear that my v2 PreTokenGenerationLambda is being invoked :frowning:

Hi there,

Unfortunately LocalStack does not support PreTokenGenerationLambda v2 at the moment. There is an open feature request for it here. I would suggest that you upvote the request to get more visibility and keep an eye on that page as any further updates regarding the feature implementation will be posted there.

Thank you for letting us know - I’ll upvote it.