Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading message when API key is expired #268

Open
ethanstrominger opened this issue Sep 12, 2024 · 3 comments
Open

Misleading message when API key is expired #268

ethanstrominger opened this issue Sep 12, 2024 · 3 comments

Comments

@ethanstrominger
Copy link

ethanstrominger commented Sep 12, 2024

Describe the bug
When api key is expired I get a 401 the response error message says "Authentication credentials were not provided". The tests in djangorestframework-api-key expect 403. Is there some configuration I can do?

To Reproduce
Steps to reproduce the behavior:

  1. Add an API Key record and set expiration date to the future.
  2. Create an API which uses [HasApiKey]
  3. Call the API from client code with the key created in step 1. It will succeed.
  4. Modify the API key expiration date to be
  5. Call the API from client code again. As expected, it will fail, but with a status code of 403, error message is misleading: Authentication credentials were not provided. This is misleading, as the credentials were provided and does not match test results from djangorestframework-api-key.
@AlekefromKz
Copy link

is this library still supported? 🤔

@florimondmanca
Copy link
Owner

Hey @AlekefromKz -- hardly!

I don't use it myself anymore and I don't have much time to dedicate to volunteer open source anymore.

I will post a quick pinned issue for maintainer seeking, waiting for another message on the README perhaps.

Greetings!

@AlekefromKz
Copy link

Hey! @florimondmanca

Thanks for your quick reply!

Thank you for creating this library! Though no longer supported, it has greatly helped the community. 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants