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 Answer
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
EXPERT
Uri
answered 2 months ago
profile picture
EXPERT
reviewed a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions