Django OAuth2 authentication backend for Sabiá (Brazil's SUS identity provider)
Project description
django-sabia-auth
Django OAuth2 authentication backend for Sabiá, Brazil's SUS (Sistema Único de Saúde) identity provider, hosted at login.sabia.ufrn.br.
Installation
pip install django-sabia-auth
Configuration
Add to INSTALLED_APPS and configure settings:
INSTALLED_APPS = [
...
"django_sabia_auth",
]
AUTHENTICATION_BACKENDS = [
"django_sabia_auth.backends.SabiaAuthBackend",
"django.contrib.auth.backends.ModelBackend",
]
SABIA_CLIENT_ID = "your-client-id"
SABIA_CLIENT_SECRET = "your-client-secret"
SABIA_REDIRECT_URI = "https://yourapp.example.com/auth/sabia/callback/"
SABIA_SCOPES = ["cpf", "email"] # optional, these are the defaults
LOGIN_REDIRECT_URL = "/dashboard/"
LOGIN_URL = "/login/"
URL Setup
# urls.py
from django.urls import path, include
urlpatterns = [
path("auth/sabia/", include("django_sabia_auth.urls")),
...
]
Usage
Add a login button to your template:
<a href="{% url 'sabia_auth:login' %}">Login with Sabiá</a>
Documentation
Full documentation is available in the docs/ directory.
Sabiá Developer Portal
For API credentials, visit the Sabiá developer page.
License
MIT © 2026 kelsoncm
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_sabia_auth-0.1.0.tar.gz.
File metadata
- Download URL: django_sabia_auth-0.1.0.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62808b8ee9db59e9392551b3bdd489f282f9189e5774951e13a0f65099467a3e
|
|
| MD5 |
a5166aec7b7d39c90d5f95ec13f15c4b
|
|
| BLAKE2b-256 |
0977fb0d4e97012b80e7762ef44349566e24cd852d4e2ee761213578a1658430
|
Provenance
The following attestation bundles were made for django_sabia_auth-0.1.0.tar.gz:
Publisher:
publish.yml on kelsoncm/django-sabia-auth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_sabia_auth-0.1.0.tar.gz -
Subject digest:
62808b8ee9db59e9392551b3bdd489f282f9189e5774951e13a0f65099467a3e - Sigstore transparency entry: 1334219446
- Sigstore integration time:
-
Permalink:
kelsoncm/django-sabia-auth@d1394acbd003f2c8ee9e2222b9f6892e4f206532 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/kelsoncm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d1394acbd003f2c8ee9e2222b9f6892e4f206532 -
Trigger Event:
release
-
Statement type:
File details
Details for the file django_sabia_auth-0.1.0-py3-none-any.whl.
File metadata
- Download URL: django_sabia_auth-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8c90e527dbc802a7b9c6bb945d3d3fddf170c976c2f0e2129e2c1f874e10953
|
|
| MD5 |
ba1335d60bca17eaea7805a425b70283
|
|
| BLAKE2b-256 |
8d81883d63752853d7fc489851f223d5269ed7ca1f11e52f2dbe3bfd9b51463c
|
Provenance
The following attestation bundles were made for django_sabia_auth-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on kelsoncm/django-sabia-auth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_sabia_auth-0.1.0-py3-none-any.whl -
Subject digest:
f8c90e527dbc802a7b9c6bb945d3d3fddf170c976c2f0e2129e2c1f874e10953 - Sigstore transparency entry: 1334219581
- Sigstore integration time:
-
Permalink:
kelsoncm/django-sabia-auth@d1394acbd003f2c8ee9e2222b9f6892e4f206532 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/kelsoncm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d1394acbd003f2c8ee9e2222b9f6892e4f206532 -
Trigger Event:
release
-
Statement type: