weenspace-auth
Identity Service Provider library for WeenSpace projects.
What this package provides
- Django app extending the auth stack with UUID v4 identities.
- User, organization, and account models for multi-account and multi-organization structure.
- External identity bindings for Microsoft, Google, Apple, Zitadel, and custom OIDC-compatible providers.
- Bridge hooks to leverage logic from the existing
weenspace.authmodule when present.
Data model overview
- A user can belong to many organizations.
- A user can belong to many accounts.
- An organization can own many accounts.
- No tenant concepts are modeled in this package.
Requirements
- Python 3.14+
- Django 6.1+
Install
poetry add weenspace-auth
or from local workspace:
poetry -C src/backend/weenspace-auth install
Integrate with a Django project
- Add app to
INSTALLED_APPS:
INSTALLED_APPS = [
# ...
"weenspace.auth",
]
- Use UUID-based custom user model:
AUTH_USER_MODEL = "weenspace_auth.IdentityUser"
Note:
- Django requires
AUTH_USER_MODELto useapp_label.ModelName. - Keep the app label
weenspace_authinAUTH_USER_MODELfor compatibility. - Values like
weenspace.auth.IdentityUserare not valid in Django settings.
- Run migrations:
python manage.py migrate
- OIDC endpoints exposed by this package:
/auth/oidc/<provider>/login/
/auth/oidc/<provider>/callback/
/auth/oidc/logout/
/auth/oidc/<provider>/logout/
/auth/oidc/<provider>/revoke/
- Optional claim mapping and default assignment:
WEENSPACE_AUTH_DEFAULT_ORGANIZATION_SLUG = "default-org"
WEENSPACE_AUTH_DEFAULT_ACCOUNT_SLUG = "default-account"
WEENSPACE_AUTH_PROVIDERS = {
"google": {
"client_id": "...",
"client_secret": "...",
"issuer": "https://accounts.google.com",
"organization_claim": "org_slug",
"account_claim": "account_slug",
"auto_create_org_account": True,
"end_session_endpoint": "",
"revocation_endpoint": "https://oauth2.googleapis.com/revoke",
"revocation_auth_method": "client_secret_post",
}
}
6. Optional provider config:
WEENSPACE_AUTH_PROVIDERS = {
"microsoft": {
"client_id": "...",
"client_secret": "...",
"issuer": "https://login.microsoftonline.com/common/v2.0",
"scopes": ["openid", "email", "profile"],
"end_session_endpoint": "https://login.microsoftonline.com/common/oauth2/v2.0/logout",
},
"google": {
"client_id": "...",
"client_secret": "...",
"issuer": "https://accounts.google.com",
"revocation_endpoint": "https://oauth2.googleapis.com/revoke",
},
"apple": {
"client_id": "...",
"client_secret": "...",
"issuer": "https://appleid.apple.com",
"revocation_endpoint": "https://appleid.apple.com/auth/revoke",
},
"zitadel": {
"client_id": "...",
"client_secret": "...",
"issuer": "https://<your-zitadel-domain>",
"end_session_endpoint": "https://<your-zitadel-domain>/oidc/v1/end_session",
"revocation_endpoint": "https://<your-zitadel-domain>/oauth/v2/revoke",
},
}
- For production migration planning when switching the user model, follow:
docs/AUTH_USER_MODEL_MIGRATION_ROLLOUT.md
Publishing
This package is prepared for publishing to PyPI via Poetry:
poetry build
poetry publish
Local development with pyenv
pyenv install -s 3.14.0
pyenv local 3.14.0
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install poetry
poetry install
poetry run pytest
Metadata
Release files for weenspace-auth 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| weenspace_auth-0.1.1.tar.gz | 11.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| weenspace_auth-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.3 kB
Release files / weenspace_auth-0.1.1.tar.gz
| Download URL | weenspace_auth-0.1.1.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8b935e5d07faf5fcff1984ca7c7415aa25c2578f7e42f0cd5a6f56f12be0d405
|
|
BLAKE2b-256 checksum How to use checksums |
525b8d4587a9a2e99a8aeaf6fabab98a563c592a71f44ae2262daa712ef18bb7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.14.0 Darwin/25.6.0
|
Release files / weenspace_auth-0.1.1-py3-none-any.whl
| Download URL | weenspace_auth-0.1.1-py3-none-any.whl |
|---|---|
| Size | 15.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c9140f1a564657e31c2ba4e871491d6791dd3b67834cb437e04fcdf3c67f8864
|
|
BLAKE2b-256 checksum How to use checksums |
3ff204c3df2d4c55c7a0ceef3d9e9d24e3e42af4d4541e868a059dadacc8b346
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.14.0 Darwin/25.6.0
|