(api-gateway): StepFunctionsIntegration doesnt pass Cognito claims with authorizer:true #30144
Labels
@aws-cdk/aws-apigateway
Related to Amazon API Gateway
bug
This issue is a bug.
closed-for-staleness
This issue was automatically closed because it hadn't received any attention in a while.
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Current StepfunctionIntegreation vtl script for integration request mapping doesnt support Cognito claims in authorization context.
#if ($includeAuthorizer) #set($inputString = "$inputString, @@authorizer@@:{") #foreach($paramName in $context.authorizer.keySet()) #set($inputString = "$inputString @@$paramName@@: @@$util.escapeJavaScript($context.authorizer.get($paramName))@@") #if($foreach.hasNext) #set($inputString = "$inputString,") #end #end #set($inputString = "$inputString }") #end
If I specify just the 'claims' in the forloop, then I will get all details:
#if ($includeAuthorizer) #set($inputString = "$inputString, @@authorizer@@:{") #foreach($paramName in $context.authorizer.claims.keySet()) #set($inputString = "$inputString @@$paramName@@: @@$util.escapeJavaScript($context.authorizer.claims.get($paramName))@@") #if($foreach.hasNext) #set($inputString = "$inputString,") #end #end #set($inputString = "$inputString }") #end
Expected Behavior
Stepfunction input contains all Cognito claims inside 'authorizer' object
Current Behavior
The authorizer.claims object is empty:
Reproduction Steps
Possible Solution
iterate over claims separately.
Additional Information/Context
No response
CDK CLI Version
2.102.0 (build 2abc59a)
Framework Version
No response
Node.js Version
20.5.1
OS
Windows 11 Pro
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: