django-sso-client-oauth
django-sso-client-oauth is a reusable Django app that simplifies the integration of Single Sign-On (SSO) functionality into your Django projects. It is designed to work seamlessly with Django-based applications and supports flexible configurations for connecting to an SSO provider.
Note: This package is currently in beta. Features and APIs may change in future releases.
Features
- SSO Integration: Easily integrate Single Sign-On functionality into your Django project.
- Customizable Settings: Configure the SSO client to work with your specific SSO provider.
- Token Management: Handle authentication tokens securely.
- Django Compatibility: Works with Django 3.2+.
Installation
Install the package using pip:
pip install django-sso-client-oauth
Alternatively, for development purposes, you can install it in editable mode:
pip install -e .
To uninstall the package:
pip uninstall django-sso-client-oauth
Quickstart
-
Add
django_sso_client_oauthto yourINSTALLED_APPSinsettings.py:INSTALLED_APPS = [ ..., "django_sso_client_oauth", ]
-
Configure the SSO client settings in your Django project:
SSO_CLIENT = { "BASE_URL": "https://sso.example.com", "CLIENT_ID": "your-client-id", "CLIENT_SECRET": "your-client-secret", "REDIRECT_URI": "https://your-app.com/sso/callback", "SCOPE": ["openid", "read", "write"], "LOGIN_REDIRECT": "/", "LOGIN_ERROR_REDIRECT": "/login/", "USERINFO_ENDPOINT": "/api/auth/me/", "AUTO_CREATE_USER": True, "SYNC_PERMISSIONS": True, }
-
Include the SSO client URLs in your
urls.py:from django.urls import path, include urlpatterns = [ ..., path("sso/", include("django_sso_client_oauth.urls")), ]
-
Run your Django server:
python manage.py runserver
Usage
Redirecting Users to the SSO Provider
To initiate the SSO flow, redirect users to the SSO provider's login page. This can be done using the utility functions provided in the django_sso_client_oauth.utils module.
Handling SSO Callbacks
The app includes built-in views to handle SSO callbacks and exchange authorization codes for tokens. These views are automatically included when you add the app's URLs to your project.
Customizing Behavior
You can customize the behavior of the SSO client by overriding the default settings or extending the provided views and utilities.
Development
To contribute to this project:
-
Clone the repository.
-
Install dependencies:
pip install -r requirements.txt
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
Disclaimer
This package is in beta. Use it in production environments with caution, and report any issues you encounter.
Metadata
Release files for django-sso-client-oauth 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| django_sso_client_oauth-1.0.0.tar.gz | 5.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_sso_client_oauth-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.9 kB
Release files / django_sso_client_oauth-1.0.0.tar.gz
| Download URL | django_sso_client_oauth-1.0.0.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
584d52532f4bd52ff468e66b8cdf8eabd307101f168e2a053c46a355a4929152
|
|
BLAKE2b-256 checksum How to use checksums |
7be0676a54103a58ccf11085742f81aee2bfeb8dc9fb642916386a70a0a6a145
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2025.
Transparency logRelease files / django_sso_client_oauth-1.0.0-py3-none-any.whl
| Download URL | django_sso_client_oauth-1.0.0-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d96c8d833ee9e96b266739a8def02af44553e7f433061eb58bc29fc7768cca95
|
|
BLAKE2b-256 checksum How to use checksums |
335ae6ffe553ac06809bbedb1adce3da03bf68bcc3f22d402249383d7785f7f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2025.
Transparency logSecurity for django-sso-client-oauth 1.0.0
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for django_sso_client_oauth-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2025.
Transparency logA 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.