I configured a lambda authorizer for AppSync. From the authorizer I return the following response:

return {
    isAuthorized: true,
    resolverContext: {
      userId: 'testUserId',
    },
  }

In AWS, my lambda handler that receives the request can extract the userId provided by the authorizer from event.identity.resolverContext.userId

In LocalStack though, the value of ‘identity’ is always set to
{"sub":"admin"} in LocalStack 2.1.0 and
an empty string “” in LocalStack 2.1.1

Here’s a link to the relevant AWS docs Resolver mapping template context reference - AWS AppSync

Let me know if there is any more information I can provide!

2 Likes

We have just pushed a new image to localstack/localstack-pro:latest which should resolve this issue. Please report back if you encounter any more issues with it!