By using AWS re:Post, you agree to the Terms of Use

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 Answer
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 picture
EXPERT
answered 7 months ago
  • 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.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions