# Invoke API Gateway function with Cognito Authentication from Javascript

**URL:** <https://forum.serverless.com/t/invoke-api-gateway-function-with-cognito-authentication-from-javascript/1451>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [March 8, 2017, 4:52pm UTC](https://forum.serverless.com/t/invoke-api-gateway-function-with-cognito-authentication-from-javascript/1451 "2017-03-08T16:52:37Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![dbeja](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/dbeja/32/498_2.png) [@dbeja](https://forum.serverless.com/u/dbeja)\
**Post date:** [March 10, 2017, 3:52pm UTC](https://forum.serverless.com/t/invoke-api-gateway-function-with-cognito-authentication-from-javascript/1451/5 "2017-03-10T15:52:04Z")

</div>

Thanks fanjie!

I’m using just a Identity Pool federated with Facebook login.

I just need to use AWS SDK Javascript or do I need to download also API Gateway SDK Javascript?

Right now I have this callback:

```
AWS.config.credentials.get(function(err){
console.log(err);
});

```

Where the user is authenticate on Cognito, but I can’t find any example on what to do next, how does AWS.APIGateway knows it’s authenticated and how do I call the functions with this apigateway. Do you know any examples I could follow? The ones I found seem to be a different case scenario.

Thank you!

---

_[View the full topic](https://forum.serverless.com/t/invoke-api-gateway-function-with-cognito-authentication-from-javascript/1451)._
