How can I deny authorization using a custom authorizer lambda when the API key is disabled?

3

hello guys,

I'm trying to disable an API key to deny all access relative to my APIs, but when I flag it as disabled the API key still works. I expected that the API gateway could refuse access, but it's not happening.

Enter image description here

As the API gateway didn't refuse the access and I'm using a custom lambda authorizer, I thought I should deny the access by myself right? I'm trying to deny it through the lambda authorizer, but I haven't seen any information on the context of the key that shows me if it is enabled or disabled.

Enter image description here

As you can see in the image above, there isn't any information about if the key is enabled or disabled. Has someone any solution for this case?

thank you.

**Update

Steps that I have tried:

  1. I flagged my API key as disabled.
  2. at API gateway > Resources > Actions -> Deploy API -> Add stage -> Deploy
  3. I hit my API, and the key still works
  4. Then I checked if some information came on context of my custom lambda authorizer
  • Have you tried to make the change and deploy the api stage?

  • Yeah, at least I think yes.

    I did it:

    1. I flagged my API key as disabled.
    2. at Resources > Actions -> Deploy API -> Add stage (DEV) as already was -> Deploy
    3. I hit my API, and it not works. so, the key still works

    do you have any other tips?

1 Answer
0

No redeployment of the Amazon API Gateway Rest API is necessary when enabling or disabling an API key. The change takes effect within approximately 10 seconds. If you encounter any issues, they are likely related to your API configuration. It is important to acknowledge that API keys are not suitable for authentication or authorization purposes, but rather serve as a means to implement rate limits, burst limits, and quotas (known as "Usage Plans").

Baw
answered 9 months 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