Access Cookie in Appsync Lambda authorization instead of authorizationToken

182 views Asked by At

I am trying to access the cookies inside Lambda authoriser of aws appsync but I am not able to do it.

As per AWS Docs if authorizationToken is not present then graphql itself return to unauthorised to user.

Any Guidance and references will be appreciated!!!

1

There are 1 answers

0
Rati_Ge On

One possible way you could achieve this is to;

  • Expose your lambda through CloudFront distribution.
  • Create the most straightforward CloudFront Function that reads your cookie and sets the header on the viewer request to pass it down to your appsync.
  • Have a custom lambda authorizer on your AppSycn that processes the cookie value and returns the value for the resolver context.