django-helseid
Django application for authenticating users with HelseID
Installation
⚠️ WARNING: This project is currently under development and is NOT production-ready. It is intended for demonstration and testing purposes only. Do not use in a production environment without thorough security review and further development. ⚠️
Requirements: Python 3.12+, Django 6.0+
-
Install the package:
pip install django-helseid
Or locally for development:
uv pip install -e .
-
Add
helseidto yourINSTALLED_APPSinsettings.py:INSTALLED_APPS = [ ... 'helseid', ]
-
Add the authentication backend:
AUTHENTICATION_BACKENDS = [ 'django.contrib.auth.backends.ModelBackend', 'helseid.backends.HelseIDBackend', ]
-
Configure
HELSEIDsettings:HELSEID = { 'CLIENT_ID': 'your-client-id', 'CLIENT_SECRET': { ... }, # JWK dict (private key) 'SCOPE': ['openid', 'profile', ...], 'ENVIRONMENT': 'production', # 'test' or 'production' }
ENVIRONMENTsets the HelseID server URL and JWT audience automatically:'test'→https://helseid-sts.test.nhn.no'production'→https://helseid-sts.nhn.no
For non-standard deployments you can override the URL explicitly instead:
HELSEID = { ... 'SERVER_METADATA_URL': 'https://helseid-sts.nhn.no/.well-known/openid-configuration', }
-
Include the URL configuration in your
urls.py:from django.urls import path, include urlpatterns = [ ... path('', include('helseid.urls')), ]
This registers the following routes:
GET /login/— initiates the HelseID authentication flowGET /authorize/— handles the OAuth2 callbackGET /logout/— clears the local session
Metadata
Release files for django-helseid 1.0.3
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 | Actions |
|---|---|---|---|---|
| django_helseid-1.0.3.tar.gz | 49.4 kB | With provenance | Details for django_helseid-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_helseid-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for django_helseid-1.0.3-py3-none-any.whl |
Total release size: 62.3 kB
Release files / django_helseid-1.0.3.tar.gz
| Download URL | django_helseid-1.0.3.tar.gz |
|---|---|
| Size | 49.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c54cb6b38f0a6a8f3d51903fe392d5b5c8e42c738b9c2b24e73319fbcddcbe36
|
|
BLAKE2b-256 checksum How to use checksums |
cdb819b43174834e4460325e44309598e52f6312ca2e1f396b8402f7abdf81f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 21, 2026.
Transparency logRelease files / django_helseid-1.0.3-py3-none-any.whl
| Download URL | django_helseid-1.0.3-py3-none-any.whl |
|---|---|
| Size | 12.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c38e7f98692e3bbcdcd0953249a44f78b07536ead5591f9fe340e38310547839
|
|
BLAKE2b-256 checksum How to use checksums |
19c215ca34464efeff155b489f1eb0a58e3341d669134327085485ca87482eb5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 21, 2026.
Transparency logSecurity for django-helseid 1.0.3
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
Both files in this release have been uploaded with provenance metadata.
Attestation for django_helseid-1.0.3.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 Jun 21, 2026.
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.