Unable to get CognitoIdentityId from Java Lambda Function
<p>I currently have an API Gateway setup to tie in Lambda functions which are written using Java. I'm using the javascript SDK to call the API Gateway endpoints and they are correctly relaying to the Lambda functions. However when I try to access the Cognito Identity ID via:</p>

<p><code>context.getIdentity()</code></p>

<p>I get the following response:</p>

<pre><code>lambdainternal.api.LambdaCognitoIdentity@xxxxxx
</code></pre>

<p>If I run </p>

<pre><code>context.getIdentity().getIdentityId()
</code></pre>

<p>It just returns a empty string in the logger. Not sure what I need to do to get the Identity ID for the user making the request to pass through to the context. </p>

<p>I'm generating the Javascript AWS Api Client via the following:</p>

<pre><code>var apiClient = apigClientFactory.newClient({
                    accessKey: credentials.accessKeyId,
                    secretKey: credentials.secretAccessKey,
                    sessionToken: credentials.sessionToken,
                    region: 'us-east-1'
                });
</code></pre>

<p>The lambda functions are secured using IAM policies and the user is able to access the lambda functions so authentication is working correctly. It's just not providing the IdentityId for some reason.</p>