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?

preguntada hace 3 meses104 visualizaciones
1 Respuesta
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
EXPERTO
Uri
respondido hace 3 meses
profile picture
EXPERTO
revisado hace un mes

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas