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?

已提問 3 個月前檢視次數 104 次
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
專家
已審閱 1 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南