# Problem accessing AWS API (with Lambda) using cognito user pool

**URL:** <https://forum.serverless.com/t/problem-accessing-aws-api-with-lambda-using-cognito-user-pool/3076>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [November 11, 2017, 8:01am UTC](https://forum.serverless.com/t/problem-accessing-aws-api-with-lambda-using-cognito-user-pool/3076 "2017-11-11T08:01:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![moindear](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@moindear](https://forum.serverless.com/u/moindear)\
**Post date:** [November 11, 2017, 8:01am UTC](https://forum.serverless.com/t/problem-accessing-aws-api-with-lambda-using-cognito-user-pool/3076/1 "2017-11-11T08:01:59Z")

</div>

I have created AWS API using Proxy and Lambda functions using C#. I have used cognito user pool for authorization. Prior to enabling the authorization everything worked fine. Now when I invoke the API from postman with “Authorization” header and Identity Token as value, I get unauthorized error.

Please help.

---

<div class="post-metadata">

**Author:** ![bill](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/bill/32/1072_2.png) [@bill](https://forum.serverless.com/u/bill)\
**Post date:** [November 12, 2017, 1:14am UTC](https://forum.serverless.com/t/problem-accessing-aws-api-with-lambda-using-cognito-user-pool/3076/2 "2017-11-12T01:14:54Z")

</div>

Without codes show us, it is hard to do anything.

When I got the unauthorized error, I do these:

1. check logs if there are any hints.

2. Clean the cache, and set the TTL to 0 to do the troubleshooting. Otherwise, even you change something, the cache still makes it unauthorized.

After fix the problem, don’t forget to change TTL value back.

1. Go to aws console, do a test directly in api gateway with that auth handler.

Good luck.
