Authenticate AWS Gateway request against Cognito user pool using the acces token instead of the id token?

0

Hi!

I'm building a new API using AWS Gateway, and I need to authenticate the requests agains my already working Cognito user pool using the acess token instead of the id token, but I did not manage to do it even changing the scopes of the methods in the gateway.

I read that is not very secure to send back to the frontend the id token instead of the access token to do the requests. So we are using the access token to do the request to my already existing API (That is not built with AWS Gateway).

How can I make the AWS Gateway work with the access token instead of the id token when the frontend send a request to this new API I need?

Thank you guys!

1 個回答
0
已接受的答案

Hi,

Please refer the link below on how to configure an API Gateway to work with cognito access tokens: https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-enable-cognito-user-pool.html

Also, there is a related article on the knowledge centre which may also be helpful.

https://repost.aws/knowledge-center/cognito-custom-scopes-api-gateway

Thanks, Rama

profile pictureAWS
Rama
已回答 4 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南