# Passing cognito identity to api/lambda

**URL:** <https://forum.serverless.com/t/passing-cognito-identity-to-api-lambda/491>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [October 11, 2016, 2:41pm UTC](https://forum.serverless.com/t/passing-cognito-identity-to-api-lambda/491 "2016-10-11T14:41:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinodhum](https://avatars.discourse-cdn.com/v4/letter/v/e56c9b/32.png) [@vinodhum](https://forum.serverless.com/u/vinodhum)\
**Post date:** [October 11, 2016, 2:41pm UTC](https://forum.serverless.com/t/passing-cognito-identity-to-api-lambda/491/1 "2016-10-11T14:41:08Z")

</div>

Hi,  
how do I pass cognito identity to lambda functions ?  
I have cognito setup and user is logged in.  
I am using JavaScript browser sdk with angular2  
tried setting header with identity object but it says header field identity is not allowed.  
I want all my http request to pick up identity automatically from cognito, is it possible ?

“identity”:{“cognitoIdentityPoolId”:"",“accountId”:"",“cognitoIdentityId”:"",“caller”:"",“apiKey”:"",“sourceIp”:"",“cognitoAuthenticationType”:"",“cognitoAuthenticationProvider”:"",“userArn”:"",

---

<div class="post-metadata">

**Author:** ![vinodhum](https://avatars.discourse-cdn.com/v4/letter/v/e56c9b/32.png) [@vinodhum](https://forum.serverless.com/u/vinodhum)\
**Post date:** [October 12, 2016, 5:53am UTC](https://forum.serverless.com/t/passing-cognito-identity-to-api-lambda/491/2 "2016-10-12T05:53:37Z")

</div>

how do i set below properties on api ?

Properties:  
AuthorizationType: AWS\_IAM #sets authorization to AWS\_IAM
