estoy tratando de implementar una solicitud de graphql no autenticada usando IAM estoy usando AWSAppSyncClient de https://www.npmjs.com/package/aws-appsync
import Auth from '@aws-amplify/auth' import AWSAppSyncClient from 'aws-appsync' new AWSAppSyncClient({ // @ts-ignore url: API_URL, // @ts-ignore region: process.env.aws_s3_region, // @ts-ignore auth: { type: AUTH_TYPE.AWS_IAM, credentials: () => Auth.currentCredentials(), }, // Uses Amazon IAM credentials to authorize requests to S3. complexObjectsCredentials: () => Auth.currentCredentials(), disableOffline: true, })Ya configuré el acceso no autenticado a AWS AppSync y configuré el rol no autenticado que se está utilizando.
cuando traté de hacer una solicitud, la respuesta fue 403
{ "errors" : [ { "errorType" : "IncompleteSignatureException", "message" : "'accept' is named as a SignedHeader, but it does not exist in the HTTP request." } ] }Encabezados de solicitud:
:authority: <URL> :method: POST :path: /graphql :scheme: https accept: */* accept-encoding: gzip, deflate, br accept-language: en-US,en;q=0.9 authorization: AWS4-HMAC-SHA256 Credential=<KEY>/20220114/eu-central-1/appsync/aws4_request, SignedHeaders=accept;content-type;host;x-amz-date;x-amz-security-token, Signature=87b4a4bf3db5d7a0084491f3947bc4414890887f5cd600b2bc14612e608db5d4 cache-control: no-cache content-length: 374 content-type: application/json; charset=UTF-8 origin: http://localhost:3001 pragma: no-cache referer: http://localhost:3001/ sec-ch-ua: " Not;A Brand";v="99", "Google Chrome";v="97", "Chromium";v="97" sec-ch-ua-mobile: ?0 sec-ch-ua-platform: "macOS" sec-fetch-dest: empty sec-fetch-mode: cors sec-fetch-site: cross-site user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36 x-amz-date: 20220114T013513Z x-amz-security-token: <TOKEN> x-amz-user-agent: aws-amplify/1.8.1 Según la respuesta de error, dice que no estoy enviando accept como encabezado, pero según los encabezados, accept se envía en los encabezados.