Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Django kerberos authentication backend

Project Description

Django kerberos authentication backend.

Install

# install via pip
pip install django-auth-krb
# or install from source
python setup.py install

Usage

RemoteKrbBackend

Make sure following settings are configured in settings.py:

INSTALLED_APPS = (
    ...
    'django_auth_krb',
    ...
)

KRB5_REALM = 'EXAMPLE.COM'

AUTHENTICATION_BACKENDS = (
   'django_auth_krb.backends.RemoteKrbBackend',
)

MIDDLEWARE = [
    ...
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.auth.middleware.PersistentRemoteUserMiddleware',
    ...
]

LOGIN_REDIRECT_URL = '/'

Include auth url in project urls.py

from django.conf.urls include

urlpatterns = [
    url(r'^auth/', include('django_auth_krb.urls')),
    ...
]

Config apache as follow if you want to use RemoteKrbBackend:

<VirtualHost *:443>
    ServerAdmin webmaster@host.example.com
    ServerName host.example.com

    SSLEngine on
    SSLCertificateFile /etc/httpd/conf/ssl.crt
    SSLCertificateKeyFile /etc/httpd/conf/ssl.key

    WSGIScriptAlias / /path/to/django/project/wsgi.py
    WSGIPassAuthorization On

    <Location "/">
        Require all granted
    </Location>

    <Location "/auth/login/">
        SSLRequireSSL
        AuthType Kerberos
        AuthName "Kerberos login"
        KrbMethodNegotiate on
        KrbMethodK5Passwd off
        KrbServiceName HTTP
        KrbAuthRealm EXAMPLE.COM
        Krb5Keytab /etc/httpd/conf/httpd.keytab
        KrbSaveCredentials off
        KrbVerifyKDC on
        Require valid-user
    </Location>
</VirtualHost>

Enable login/logout view in url.py:

from django.conf.urls import include

urlpatterns = patterns('',
    ...
    url(r'^auth/', include('django_auth_krb.urls')),
    ...
)
Release History

Release History

This version
History Node

0.2.0

History Node

0.1.1

History Node

0.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django_auth_krb-0.2.0.tar.gz (5.4 kB) Copy SHA256 Checksum SHA256 Source Nov 4, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting