has anyone been seeing random 401 errors with the ...
# help
s
has anyone been seeing random 401 errors with the HTTP API? it makes no sense to me. the previous requests are totally fine.. then boom, a random 401. and if I resend the exact same request, I get HTTP 200.
I have no clue how to debug this 😞 seems to me like it’s an issue with HTTP API. the response was super fast (64ms) and it didn’t hit Lambda at all
f
Which request is super fast and didnt hit lambda? The 401?
s
yep. in other words, API Gateway rejected it as unauthorized right away
then when I resent it, same exact request 100%, I get a 200
I’ll have to replicate this to get an API Gateway request ID, then contact AWS support
o
I came across an issue thats kind of similar: https://github.com/auth0-samples/jwt-rsa-aws-custom-authorizer/pull/8 The symptoms aren’t exactly the same, but maybe it’s a clue. Try disabling the authorizer cache if you have it set, see if you still get the issue
That issue was with the REST API, but looks like the behaviour is similar with HTTP API: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html#http-api-lambda-authorizer.caching
s
whoa. ok, I inspected the HAR file.. and I see this in the response:
Copy code
{
              "name": "www-authenticate",
              "value": "Bearer scope=\"\" error=\"invalid_token\" error_description=\"non-200 status code received from OIDC discovery endpoint\""
            },
opened an AWS support ticket. we’ll see what they say.