Lambda Authorizer Always Returning Unauthorized

0

I have a python lambda authorizer with the following code:

def lambda_handler(event, context):
    return {
        "isAuthorized": True,
        "context": {
            "exampleKey": "exampleValue",
        }
    }

It is connected to an API Gateway route with the following configuration: Lambda Authorizer API Gateway Configuration

It always return {"message":"Unauthorized"} when the /dataset/classes route is used. Why doesn't it continue to the integrated function if isAuthorized is always set to true?

1개 답변
0

Can it be that you do not have an authorization header in your request? You configured the authorizer to receive that header, so if it does not exist, API Gateway will not even invoke the function and it will return an error.

profile pictureAWS
전문가
Uri
답변함 3달 전
profile picture
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠