Skip to content

Accessing request cookies header in a AppSync NodeJS Lambda Resolver #4486

Open
@isi-gach

Description

@isi-gach

How can I get the request cookies in an AppSync Javascript Lambda Resolver?
It seems that it could be done using a Request Body Mapping Template
https://faragta.com/aws-api-gateway/pass-cookie-values-from-api-gateway.html
With this VTL call $util.escapeJavaScript($input.params().header.Cookie)
but I don't know what's the equivalent for Amplify/AppSync

Ideally using configuration files instead of the AWS Console UI.

The use case is reading a request cookie with the HttpOnly flag (so it's not accessible in the browser), apply sha256 to that cookie and make a new Http request.

Metadata

Metadata

Labels

AppSyncRelated to AppSync issuesGraphQLRelated to GraphQL API issuesService TeamIssues asked to the Service Teamfeature-requestRequest a new feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions