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 Antwort
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
EXPERTE
Uri
beantwortet vor 2 Jahren
  • 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.

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen