This Django middleware package enables authentication via request headers sent by an ingress reverse proxy. It provides a seamless way to integrate with existing reverse proxy setups, allowing developers to authenticate users based on headers such as X-SSL-User-DN
. This approach is particularly useful in microservices architectures, where the reverse proxy handles authentication upstream. This package is designed to be easily configurable, supporting various header names and formats, ensuring flexibility and adaptability to different environments. With this middleware, developers can enhance security and streamline user management across distributed systems, making it an ideal choice for projects leveraging reverse proxies for authentication.
The full documentation is at https://django-mtls-auth.readthedocs.io.
Install django-mtls-auth
pip install django-mtls-auth
Add it to your MIDDLEWARE
MIDDLEWARE = [
...
"mtls_auth.middleware.MTLSAuthenticationMiddleware",
]
- Authentication
- Documentation
- Authorization
- Audit
Does the code actually work?
cd django-mtls-auth
poetry install
poetry run pytest
# or
poetry run nox
Tools used in rendering this package: