Skip to main content

Django PAM authentication backend implementation.

Project description

License PyPI Version Python Versions PyPI Wheel Build Status Coverage PyPI Downloads

A Django PAM authentication backend implementation.

The MIT License (MIT)

Overview

This is a simple authentication backend that uses the python-pam package. Django PAM can be used in an SSO (Single Sign On) environment or just with a single box where you want to log into a Django app with your UNIX login.

Updated for Django 6.0.x and Python 3.13.

Python 2.x has been depricated. If you need a version of Django PAM use version 2.0.1.

Provides

  1. PAM Authentication Backend

  2. Login and Logout Views

  3. Templates for both standard and modal authentication.

  4. Supporting JavaScript and CSS.

Quick Start

You will need to add Django PAM to your INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'django_pam',
]

Next you will need to add the Django PAM backend to the AUTHENTICATION_BACKENDS:

AUTHENTICATION_BACKENDS = [
    'django_pam.auth.backends.PAMBackend',
    'django.contrib.auth.backends.ModelBackend',
]

The user that runs the application needs to be a member of the /etc/shadow file group, this is usually the web server user. This is necessary so the web server can authenticate other users. To do this run the command below with the proper user:

$ sudo usermod -a -G shadow <user>

Or if you need to run tests as a different user you can do this:

$ newgrp shadow
$ source venv/bin/activate
$ ./manage.py test

Complete Documentation can be found on Read the Docs at: Django PAM

Project details


Download files

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

Source Distribution

django_pam-3.0.0.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_pam-3.0.0-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file django_pam-3.0.0.tar.gz.

File metadata

  • Download URL: django_pam-3.0.0.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.12.3 HTTPX/0.28.1

File hashes

Hashes for django_pam-3.0.0.tar.gz
Algorithm Hash digest
SHA256 ad09e38520ff56b056e1346ee449c96e2300cfb10363d7d8d8f0ee78e62e0cf7
MD5 9fdbf0bb26a29a2d8e12b162bab04a3e
BLAKE2b-256 a6b3252311c0ae3876bc8f5b99df329872d0c6f0678c342744fc2c0bb395a10d

See more details on using hashes here.

File details

Details for the file django_pam-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: django_pam-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.12.3 HTTPX/0.28.1

File hashes

Hashes for django_pam-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ff312f27aa1a22132d35e6bc27e32ee99df21554a6680db71d8c70a3cce004c
MD5 682f902b6b6f1e12b3b967dd4023bb12
BLAKE2b-256 9bcd4efcff66c91307bd1eeca65430bea9c025b3396825a3e70deea9d7df6214

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page