"Missing Authentication Token" when using the AWS apigclient (with credentials)
<p><strong>Update</strong>
I resolved this by removing the old pool and creating a new one. I believe the problem was in the end wrongly configured cognito roles. It works as expected now.</p>

<hr>

<p>I'm having some issues with the API Gateway client (Javascript/Browser) when trying to access an protected lambda (Authorization : AWS_IAM) via the API Gateway.</p>

<p>The problem is that I keep getting "Missing Authentication Token" when calling the resource via the apiClient for my API Gateway.</p>

<p>I'm following the "enhanced flow" under Developer Authenticated Identities Authflow ref: <a href="http://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html?shortFooter=true" rel="nofollow">http://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html?shortFooter=true</a></p>

<p>Is it possible to protect lambdas like this at all, or do I have to use an authorizer for my case? I was under the impression that my temporary credentials from cognito could be used as a IAM for the duration, but it could explain a lot. I have an authorizer planned for later - for protecting other resources. </p>

<p>The actual call to the lambda is like this:</p>

<pre><code>  var params = {};

  var body = {
    message: vm.message
  };

  var additionalParams = {
    headers: {},
    queryParams: {}
  };

  var apiClient = apigClientFactory.newClient( {
    accessKey    : data.awstoken.AccessKeyId,
    secretKey    : data.awstoken.SecretAccessKey,
    sessionToken : data.awstoken.SessionToken,
    region       : Config.aws.region
  });

  apiClient.testEchoPost( params, body, additionalParams )
    .then( function ( result ) {
      console.info( 'TEST_RESULT', result );
    })
    .catch( function ( error ) {
      console.error( 'dang', error );
    });
}
</code></pre>