aws-mobile-appsync-sdk-js icon indicating copy to clipboard operation
aws-mobile-appsync-sdk-js copied to clipboard

Add custom header

Open jacekv opened this issue 5 years ago • 3 comments
trafficstars

Good morning everyone,

I am working on a project, where I have a lambda function which acts as a proxy between a client and Aws AppSync. First we used API Key as authentication method for AppSync but we want to switch to IAM authentication. I found an example on how to forward graphql queries and mutations using your sdk.

It is possible to pass http header information to AppSync, which can be accessed through the $context.request.headers object. Is there a way of setting customer header information in your sdk?

I tried to find a way but I haven't found anything documented. I also checkd the issues but it seems like most people are having a hard time with this.

Best Jacek

jacekv avatar Sep 10 '20 06:09 jacekv

+1 @jacekv have you found a way to add a custom HTTP header to the AppSync requests?

jakubsekowski avatar Feb 04 '21 17:02 jakubsekowski

Sadly, we haven't found a simple way. At the end we solved it using a gateway which added the required header.

jacekv avatar Feb 05 '21 12:02 jacekv

I thought I am alone, any other alternatives?

bpcrao avatar Jul 22 '21 04:07 bpcrao