7
votes

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?

2
At the moment you cannot set the response headers on a GraphQL query or mutation. Can you explain what your use case is? - Karthik
Oh sure, I want to use httpOnly cookie with appsync, for this I need to set them, for it I want set header "Set-Cookie" - Константин Костылев
Did you have any luck with this? I need the same. - ctrlplusb

2 Answers

0
votes

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.