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 Risposta
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
ESPERTO
Uri
con risposta 3 mesi fa
profile picture
ESPERTO
verificato un mese fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande