A Django app for HelseID authentication.
Project description
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
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
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_helseid-1.0.3.tar.gz.
File metadata
- Download URL: django_helseid-1.0.3.tar.gz
- Upload date:
- Size: 49.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c54cb6b38f0a6a8f3d51903fe392d5b5c8e42c738b9c2b24e73319fbcddcbe36
|
|
| MD5 |
110aa56a5064db2444e52bff23b0dea6
|
|
| BLAKE2b-256 |
cdb819b43174834e4460325e44309598e52f6312ca2e1f396b8402f7abdf81f6
|
Provenance
The following attestation bundles were made for django_helseid-1.0.3.tar.gz:
Publisher:
publish.yml on haakontk/django-helseid
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_helseid-1.0.3.tar.gz -
Subject digest:
c54cb6b38f0a6a8f3d51903fe392d5b5c8e42c738b9c2b24e73319fbcddcbe36 - Sigstore transparency entry: 1902032948
- Sigstore integration time:
-
Permalink:
haakontk/django-helseid@e2c1b8d02044fb24f1111d6579a09ea64de87f35 -
Branch / Tag:
refs/tags/v1.0.4 - Owner: https://github.com/haakontk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e2c1b8d02044fb24f1111d6579a09ea64de87f35 -
Trigger Event:
release
-
Statement type:
File details
Details for the file django_helseid-1.0.3-py3-none-any.whl.
File metadata
- Download URL: django_helseid-1.0.3-py3-none-any.whl
- Upload date:
- Size: 12.9 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 |
c38e7f98692e3bbcdcd0953249a44f78b07536ead5591f9fe340e38310547839
|
|
| MD5 |
51ff16df97a5d5e2bf7f643bed28134c
|
|
| BLAKE2b-256 |
19c215ca34464efeff155b489f1eb0a58e3341d669134327085485ca87482eb5
|
Provenance
The following attestation bundles were made for django_helseid-1.0.3-py3-none-any.whl:
Publisher:
publish.yml on haakontk/django-helseid
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_helseid-1.0.3-py3-none-any.whl -
Subject digest:
c38e7f98692e3bbcdcd0953249a44f78b07536ead5591f9fe340e38310547839 - Sigstore transparency entry: 1902033038
- Sigstore integration time:
-
Permalink:
haakontk/django-helseid@e2c1b8d02044fb24f1111d6579a09ea64de87f35 -
Branch / Tag:
refs/tags/v1.0.4 - Owner: https://github.com/haakontk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e2c1b8d02044fb24f1111d6579a09ea64de87f35 -
Trigger Event:
release
-
Statement type: