title: AWS Cognito with Serverless Local Environment
body: <p>This is an issue we found on <a href="https://github.com/dherault/serverless-offline/issues/487" rel="nofollow noreferrer">Github</a> and are having the same issue:</p>
  
  <blockquote>
    <p>We're using serverless and serverless-offline to run lambda locally.
    We have a local DynamoDB implementation. For Cognito however,
    serverless-offline mocks the authenticated user and cognitoIdentityId.
    The mocked user has permission to invoke the lambda but not to pass in
    the cognitoIdentityId to match what we save in DynamoDB for a user.</p>
    
    <ol>
    <li>This may be a serverless-offline problem, and there may be other,
    better solutions. </li>
    <li>Or there may be a way to run Cognito locally.</li>
    <li>Or we can hit Cognito from our local. But we don't know how to do this.</li>
    </ol>
    
    <p>tldr; I'm not sure what the best practice is around developing labmdas
    locally when using Cognito with authorizer: aws_iam</p>
  </blockquote>