Pre Token Generation trigger: This Lambda trigger allows you to customize an identity token before it is generated: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-token-generation.html
I am looking for a way to configure this trigger via CloudFormation. Something like:
UserPool:
Type: AWS::Cognito::UserPool
Properties:
LambdaConfig:
# Next line does not work:
PreTokenGeneration: [lambda ARN]
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cognito-userpool-lambdaconfig.html
I found docs for other triggers, but this one is missing. Is this a missing feature or just not documented?
This Lambda trigger allows you to customize an identity token before it is generated. You can use this trigger to add new claims, update claims, or suppress claims in the identity token.
Scroll down on this page and choose Pre Token Generation as a Trigger option. Select the Lambda function created in the previous step and save the changes. Create a test-user in Cognito User Pool like below and verify the user email address
The Access Token grants access to authorized resources. The Refresh Token contains the information necessary to obtain a new ID or access token. In this post we will talk about how to add custom JWT claims to an ID Token generated by a Cognito User Pool using the Pre token Generation Lambda Trigger.
Through the event [‘response’] [‘claimsOverrideDetails’] key, we can override or add custom ID token claims to the JWT token in this case pet_preference. Return the modified token back.
https://forums.aws.amazon.com/thread.jspa?threadID=268907
It's on their roadmap but there're no news since cognito's cloudformation launch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With