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?
Select the web site where you want to add the custom HTTP response header. In the web site pane, double-click HTTP Response Headers in the IIS section. In the actions pane, select Add. In the Name box, type the custom HTTP header name.
$ctx and $context in AWS AppSync refer to the same Resolver Context. We added $ctx as an alias for $context to reduce the number of characters users have to type ( $ctx is 50% shorter than $context !!) Choosing $context or $ctx is a personal preference.
PDF. Data sources and resolvers are how AWS AppSync translates GraphQL requests and fetches information from your AWS resources. AWS AppSync has support for automatic provisioning and connections with certain data source types.
AWS AppSync is a serverless GraphQL and Pub/Sub API service that simplifies building modern web and mobile applications. AWS AppSync GraphQL APIs simplify application development by providing a single endpoint to securely query or update data from multiple databases, microservices, and APIs.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With