Skip to main content
* Django-TLSAuth

Django-TLSAuth integrates a minimal certificate authority (CA) and
implements TLS client certificate authentication. It depends on nginx
for handling the TLS authentication part.

** Installation
#+BEGIN_SRC sh
pip install django_tlsauth
#+END_SRC
Django-TLSAuth depends on tlsauth which provides minimal tools to
act as a CA. Please follow the "CA and https service install" steps
from https://github.com/stef/tlsauth to set up your webserver and CA.

After setting up the CA, you should also configure it in django,
put something like this with adjusted paths into your settings.py:
#+BEGIN_SRC python
from tlsauth import CertAuthority

TLS_CA=CertAuthority('<path-to-CA>')
TLS_ADMINGROUPS=['CA admins']
TLS_SCRUTINIZER=None # supply your own function authorizing automatic signatures
TLS_BLINDSIGN=False # blindly sign incoming CSRs
#+END_SRC

If you want to enable the admin to the mini-CA add to your urls.py
#+BEGIN_SRC python
url(r'^tlsauth/', include('django_tlsauth.urls')),
#+END_SRC

** tlsauth decorator
Django-TLSAuth provides a simple decorator to guard your entry points:
#+BEGIN_SRC python
from django.http import HttpResponse, HttpResponseRedirect
from django_tlsauth.views import tlsauth

def unauth(request):
return HttpResponseRedirect('/')

@tlsauth(unauth=unauth, groups=['helloworldophobians'])
def hello(request):
return HttpResponse("hello world")
#+END_SRC

** Managing certs
Django-TLSAuth provides a few default routes to manage the certs and
the CA.

*** /tlsauth/register/
Visitors can register like on a normal site, but when done, they get a
PKCS12 certificate ready to be saved and imported in all
browsers. This is totally automatic and there's no check if the
specified organization is not a privileged one (like "CA admins" in
the above example). This really provides no security, for bots and
scripts it's even easier to use these certs than for normal humans.
Other mechanisms must be deployed to provide meaningful authentication.

*** /tlsauth/certify/
Visitors can submit their Certificate Signing Request (can be easily
generated using gencert.sh from tlsauth), which depending on
configuration either returns automatically a signed certificate (no
meaningful authentication this way, avoid this!), or it gets stored
for later approval by the "CA admins".

*** /tlsauth/cert/
Returns the CA root certificate in PEM format, for import into your browser.

*** /tlsauth/csrs/
Displays a list of incoming CSRs to any certified member of the "CA
admin" group. The certs can be either rejected or signed, in the later
case the resulting certificate is sent to the email address of the
subject.

*** /tlsauth/test/
Displays whether you are TLS authenticated and what your distinguished name is.

Metadata

Release files for django_tlsauth 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django_tlsauth 0.1.2
File Size Uploaded Provenance
django_tlsauth-0.1.2.tar.gz 7.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django_tlsauth 0.1.2
File Interpreter ABI Platform
django_tlsauth-0.1.2-py2.7.egg Legacy Egg format - - Details

Total release size: 25.2 kB

Release files / django_tlsauth-0.1.2.tar.gz

Download URL django_tlsauth-0.1.2.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a9d530063a716e44a510adb3347a52e42cae26a6e7fac9a96d5b4c4a2d9387ce
BLAKE2b-256 checksum
How to use checksums
19ca805e31efc77785e74d3385b9fbe04bf905d2d03920ea6aecfb38de781dc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_tlsauth-0.1.2-py2.7.egg

Download URL django_tlsauth-0.1.2-py2.7.egg
Size 17.7 kB
Tags Egg
SHA-256 checksum
How to use checksums
a90321cea0970c26d638b72bc6391b5e468224b62119d2c8774847e5e6ed5f65
BLAKE2b-256 checksum
How to use checksums
97b5256ca382599bf620ea0f34d7398aa1a6cf2b8e39925b7aebd6476c7807df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django_tlsauth 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page