Skip to main content

A Django app to provide an SP client for Login.gov.

Project description

Django Login.gov Integration

PyPI version License

A Django app that provides a seamless integration with Login.gov for authentication.

Overview

The django-logingov app makes it easy to integrate Login.gov authentication into your Django project. It provides a complete solution for handling Login.gov's OpenID Connect flow, including user creation and linking, customizable login buttons, and admin configuration.

Features

  • Complete Login.gov Integration: Full OpenID Connect implementation with up-to-date support for all current Login.gov authentication levels (IAL and AAL)
  • User Management: Automatically create and link Django users to Login.gov accounts and set a default group
  • Customizable Login Buttons: Templatetags that generate the standard Login.gov buttons according to Login.gov User Experience guidelines
  • Admin Configuration: Easy-to-use Django admin interface for setting up Login.gov service provider settings
  • Multi-language Support: Translations for English, French, Spanish, and Japanese
  • Sandbox and Production Modes: Toggle between Login.gov sandbox and production environments
  • Flexible Scopes: Configure which user information to request from Login.gov
  • USWDS Compatible: Works with the USWDS design system for consistent button styling

UI Screenshots

Admin Interface

Login.gov Admin Settings

The Django admin interface provides a user-friendly way to manage Login.gov service provider settings.

Login Buttons

Login Buttons Set

The templatetags create standard Login.gov buttons that follow the Login.gov User Experience guidelines.

Quickstart

  1. Install the package:
pip install django-logingov
  1. Add to your Django settings:
INSTALLED_APPS = [
    ...
    'logingov',
]

MIDDLEWARE = [
    ...
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    ...
]

# Static files configuration (required for the login button CSS)
STATIC_URL = 'static/'
STATICFILES_DIRS = [
    BASE_DIR / "static",
]
  1. Add the URLs to your root urls.py:
from django.urls import path, include

urlpatterns = [
    ...
    path("logingov/", include("logingov.urls")),
    ...
]
  1. Run migrations:
python manage.py migrate
  1. Visit your project's administration section to configure Login.gov settings.

See the INSTALL.md for more detailed setup instructions.

Requirements

  • Django 5.2+
  • Python 3.12+

License

This project is licensed under the BSD license - see the LICENSE file for details.

Support

For questions, support, or to report a bug, please open an issue on the GitHub repository.

Patches are welcome! To contribute to the project, please submit a PR on GitHub linked to an issue.

Project details


Release history Release notifications | RSS feed

This version

0.8

Download files

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

Source Distribution

django_logingov-0.8.tar.gz (30.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_logingov-0.8-py3-none-any.whl (44.3 kB view details)

Uploaded Python 3

File details

Details for the file django_logingov-0.8.tar.gz.

File metadata

  • Download URL: django_logingov-0.8.tar.gz
  • Upload date:
  • Size: 30.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for django_logingov-0.8.tar.gz
Algorithm Hash digest
SHA256 92c20ff4f8f6ef962e16f6ba9ba5c800e50ef04a3fa5eaa63a2c10b4e409878c
MD5 776de665bdb138899658db140e4bf29c
BLAKE2b-256 c37fe2f939ac3876378fa85f913d75d8dc0b4bd823bb4c68e26ea265e478f1f9

See more details on using hashes here.

File details

Details for the file django_logingov-0.8-py3-none-any.whl.

File metadata

  • Download URL: django_logingov-0.8-py3-none-any.whl
  • Upload date:
  • Size: 44.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for django_logingov-0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 db40b78c4c475531693a7ba93e2624565537d7ea1e50842a5b4f3703c8fd90e1
MD5 f57f47e0a552080929a6dc08b14c8b14
BLAKE2b-256 aae54cc23df039ffecd2db01978e26943e1b16b5b42fdc7f5b098fa8e4bd9bb4

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