Unable to add custom claims to authentication token with PowerTools v3.9.0 and later #7537
              
                Unanswered
              
          
                  
                    
                      ogis-takeuchi
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
The following process worked correctly with PowerTools for AWS Lambda (Python) v3.8.0 and earlier, but since v3.9.0, the response in the returned raw_event no longer contains the custom claims.
I would like to avoid directly editing the raw_event dictionary. Is there any recommended way to add custom claims to the authentication token in v3.9.0 or later?
Here is a simplified version of my handler:
Difference in raw_event between v3.8.0 and v3.9.0
■v3.8.0 raw_event example:
■v3.9.0 raw_event example:
}
With v3.9.0 and later, the returned event does not contain the expected values in response.
Is there a way to add custom claims without directly modifying the raw event dictionary?
If there is a new recommended approach or migration guide for this use case, I would appreciate your advice.
Environment:
AWS Lambda (Python3.13)
PowerTools for AWS Lambda (Python) v3.9.0
Cognito Pre Token Generation Trigger
Lambda deployment: Container image (not Zip package)
Beta Was this translation helpful? Give feedback.
All reactions