title: API Gateway Authorizer is not being called
body: <p>I have created some Lambda Functions and deployed them using SAM. The deployment is successful, but when trying to reach the endpoints I always obtain</p>
  
  <pre><code>{ message: "Unauthorized" }
  </code></pre>
  
  <p>Even I'm sending a correct Bearer token using the <code>Authentication</code> header.
  Then if I go to the Authorizer and run the test, it passes well and generates logs in CloudWatch, but when I run a request from my frontend app or a REST client app to the endpoint, I get the unauthorized message and checking CloudWatch, there's not an execution of the authorizer function.</p>
  
  <p>Besides, checking the Authorizer function from the Lambda configuration, I can see that there's an error in the <code>API Gateway Trigger</code>, but don't know what it means.</p>
  
  <p>I created the authorizer function using the guide provided by AWS: <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-use-lambda-authorizer.html#api-gateway-lambda-authorizer-lambda-function-create" rel="nofollow noreferrer">https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-use-lambda-authorizer.html#api-gateway-lambda-authorizer-lambda-function-create</a></p>
  
  <p>Sharing my SAM configuration</p>
  
  <pre><code>Resources:
   SomeAPI:
      Type: AWS::Serverless::Api
      Properties:
        StageName: Prod
        TracingEnabled: true
        Auth:
          DefaultAuthorizer: MyLambdaTokenAuthorizer
          Authorizers:
            MyLambdaTokenAuthorizer:
              FunctionArn: !GetAtt AuthorizerFunction.Arn
  
    GetActivityStreamFunction:
      Type: AWS::Serverless::Function
      Properties:
        CodeUri: get-activity-stream/ 
        Handler: index.handler
        Layers:
          - !Ref DepencenciesLayer
          - !Ref DatabaseLayer
        Events:
          GetActivityStream:
            Type: Api
            Properties:
              RestApiId: !Ref SomeAPI
              Path: /activity-stream
              Method: get
  
    ## Authorizer Function
    AuthorizerFunction:
      Type: AWS::Serverless::Function
      Properties:
        Layers:
          - !Ref DepencenciesLayer
        CodeUri: authorizer/ 
        Handler: index.handler
  </code></pre>
  
  <p>Regarding the response sent back by the Authorizer, it sends all the params requested by API Gateway</p>
  
  <pre><code>{
        principalId: decoded.sub,
        policyDocument: getPolicyDocument("Allow", params.methodArn),
        context: { scope: decoded.scope }
  }
  </code></pre>
  
  <p>The runtime I'm using is <code>nodejs12.x</code>, and here are some screenshots of what a I get from AWS console.</p>
  
  <p><a href="https://i.stack.imgur.com/93OOH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/93OOH.png" alt="Testing the Authorizer"></a></p>
  
  <p><a href="https://i.stack.imgur.com/BBxEw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BBxEw.png" alt="Checking the API endpoint config"></a></p>
  
  <p><a href="https://i.stack.imgur.com/7ibP0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7ibP0.png" alt="Error showed on Lambda console"></a></p>