AWS Api Gateway Authorizer + Cognito User Pool Not Working {"message": "Unauthorized"}

Manivannan Guru picture Manivannan Guru · Sep 21, 2017 · Viewed 10.9k times · Source

I am trying to use aws api gateway authorizer with cognito user pool. It is working fine when i test using aws api gateway console.

But when i try enabling the authorization in the api it says "message": "Unauthorized". Please check below screenshot

API Gateway Console Screenshot - This works fine enter image description here

Postman Screen shot - Not working enter image description here

Can someone help please.

FYI I have followed the instructions as mentioned here http://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-integrate-with-cognito.html

Answer

Long Nguyen picture Long Nguyen · Jun 29, 2018

In my case, authorization code should be id_token. I made a mistake for using access_token instead