How to access http headers in custom authorizer AWS lambda function

后端 未结 3 711
没有蜡笔的小新
没有蜡笔的小新 2020-12-31 13:52

From API Gateway, I created a custom authorizer for my API using Lambda function in python. API Gateway hands over the incoming auth token using a header I configure(m

3条回答
  •  情书的邮戳
    2020-12-31 14:32

    Here is a SAM template:

    ApiGatewayApi:
        Type: AWS::Serverless::Api
        Properties:
          StageName: Prod
          Auth:
            Authorizers:
              MyAuthorizer:
                FunctionPayloadType: REQUEST
                FunctionArn: !GetAtt AuthLambda.Arn
                Identity:
                  Headers:
                    - X-API-KEY
                    - X-API-ID
    

提交回复
热议问题