APIs failing in AWS with 500 Internal server error when authorizer is configured

Hello, I have a simple handler with lambda authorizer configured. The handler works fine in offline. But in AWS, it is failing with 500 Internal Server error. The handler works fine in AWS if authorizer is not configured in serverless YML.


module.exports.hello = async (event, context, callback) => {
        const responseBody = {
            "key3": "value3",
            "key2": "value2",
            "key1": "value1"
        const response = {
            "statusCode": 200,
            "headers": {
                "my_header": "my_value"
            "body": JSON.stringify(responseBody),
            "isBase64Encoded": false
        return response;

Serverless YML Functions

    handler: handlers/authHandler.authenticate
    handler: handlers/helloHandler.hello
      - http:
          path: hello
          method: get
          cors: true
          authorizer: authorize

If you add some logging to your authenticate function, is it successfully returning a well formed IAM policy?