Leveraging django-axes?
See original GitHub issueFirst of all: thanks for releasing and maintaining djoser, it has made our life easy…!
I am trying to implement django-axes in front of djoser and things appear to be mostly working, although the error that bubbles back from JWT create is the normal error:
No active account found with the given credentials
Is there any (simple way) to get a “you’ve been ratelimited” message back? If I try to login through the normal /admin
pages I get a clear lockout message.
Relates to #7
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
6. Integration - django-axes documentation - Read the Docs
Axes is intended to be pluggable and usable with custom authentication solutions. This document describes the integration with some popular 3rd party packages ......
Read more >django-axes - Python Package Health Analysis - Snyk
Learn more about django-axes: package health score, popularity, security, maintenance, ... Easily fix your code by leveraging automatically generated PRs.
Read more >Throttling brute force login attacks in Django - Stack Overflow
If you are using DRF, then you don't need an additional library (axes, ratelimit, etc.) because DRF already has the throttling functionality ...
Read more >Django Defender: Prevent Brute force Attempts to Log in
The django-axes login speed, will probably be the slowest of the three since it does more checks and does a lot of database...
Read more >django-sudo alternatives - Linux Security Expert
It leverages the django-otp tooling together with Django's authentication framework. ... Project details. django-axes is written in Python.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
OK got this working! Here’s how I did it:
And then, bonus, to get my frontend to render JSON easily I made a template and made
django-axes
point to it.templates/lockout_error.json
Downsides:
.json
template?I setup a small example project here: https://github.com/ckcollab/djoserdjangoaxesexample
I tested with the normal admin, after a few attempts I’m blocked and displayed a message properly: http://127.0.0.1:8000/admin/login/
And for token creation, I am ratelimited but it’s not clear: http://127.0.0.1:8000/auth/jwt/create
Response I get from JWT endpoint even with correct credentials (no indication I am ratelimited):
Thanks for the help! I hope this benefits the next guy down the line as well 😃