Signing requests with Cognito token to API Gateway necessary?

0

I have an application that uses Cognito for authentication. I also use API Gateway. I read here that

The AWS SDKs, AWS Command Line Interface (AWS CLI), and other AWS tools sign API requests for you using the access key that you specify when you configure the tool. When you use these tools, you don’t need to learn how to sign API requests

So if I'm making fetch requests to API Gateway, is it still necessary to manually sign these requests with the tokens from Cognito? Or is there a way around that?

1 Respuesta
2

No, when using API Gateway with a Cognito authorizer it is not needed. The token should just be placed in the Authorization header. Signing is used when calling AWS APIs or when using the IAM Authorizer in API Gateway. The signing is done using a mechanism called SigV4.

profile pictureAWS
EXPERTO
Uri
respondido hace 2 años
  • Which token should be used? I noticed that the access token does not have a "sub" field for identifying the user.

  • You can use an ID token or an Access token.

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas