7

I want to authorize the user through http only cookies.

I want to set header in the AppSync response as example "Set-Cookie": "cookie=cookie; HttpOnly"

in "Configure the response mapping template" I have $util.toJson($context.result)

How can I do that?

shilovk
  • 11,718
  • 17
  • 75
  • 74

2 Answers2

1

This is now possible through $util.http.addResponseHeader: https://docs.aws.amazon.com/appsync/latest/devguide/resolver-util-reference.html#http-helpers-in-utils-http

The_Outsider
  • 146
  • 8
0

It seems that Appsync doesn't allow you to pass the request cookie header to a lambda. You can pass other headers like authorize or x-api-key or cookies but cookie seems to get stripped from the event. I haven't found anything in the documentation about this behavior but from observation, this is what is happening currently. You will need to pass your auth data in another header.

yodaisgreen
  • 2,310
  • 3
  • 22
  • 27