DjangoCMS OIDC (OpenID Connect) plugins for Aldryn form fields
Plugins for post a data hangovered from OpenID provider, based on plugins DjangoCMS OIDC and Aldryn Forms.
Installation
$ pip install djangocms-oidc-form-fields
Add settings to settings.py
Start by making the following changes to your settings.py file.
# Add 'aldryn_forms' and 'djangocms_oidc_form_fields' to INSTALLED_APPS
INSTALLED_APPS = [
# ...
'multiselectfield',
'django_countries',
'mozilla_django_oidc', # place after auth (django.contrib.auth)
'djangocms_oidc',
'aldryn_forms',
'djangocms_oidc_form_fields',
]
AUTHENTICATION_BACKENDS = [
# ...
'djangocms_oidc.auth.DjangocmsOIDCAuthenticationBackend',
]
MIDDLEWARE = [
# ...
'djangocms_oidc.middleware.OIDCSessionRefresh',
]
# Define OIDC classes
OIDC_AUTHENTICATE_CLASS = "djangocms_oidc.views.DjangocmsOIDCAuthenticationRequestView"
OIDC_CALLBACK_CLASS = "djangocms_oidc.views.DjangocmsOIDCAuthenticationCallbackView"
OIDC_OP_AUTHORIZATION_ENDPOINT = "https://example.com/authorization-endpoint"
OIDC_RP_CLIENT_ID = "myClientId"
Add OIDC urls to urls.py
Modify your project urls.py file.
urlpatterns = [
# ....
path('oidc/', include('mozilla_django_oidc.urls')),
path('djangocms-oidc/', include('djangocms_oidc.urls')),
]
Usage in administration
These plugins are available to the editor in the administration:
OIDC Fields
OIDC Text
OIDC Textarea
OIDC Hidden
OIDC Email
OIDC EmailIntoFromField
OIDC Phone
OIDC Number
OIDC Boolean
OIDC Span element
How to use provider MojeID
Home › Djangocms_Oidc › Oidc register consumers › oidc register consumer: Add
Name: MojeID TestRegister consumer: https://mojeid.regtest.nic.cz/oidc/registration/
Home › Djangocms_Oidc › Oidc providers › oidc provider: add
Name: MojeID TestCode: mojeidRegister consumer: MojeID TestAuthorization endpoint: https://mojeid.regtest.nic.cz/oidc/authorization/Token endpoint: https://mojeid.regtest.nic.cz/oidc/token/User endpoint: https://mojeid.regtest.nic.cz/oidc/userinfo/Account URL: https://mojeid.regtest.nic.cz/editor/Logout URL: https://mojeid.regtest.nic.cz/logout/
Page structure: Add
OpenID Connect: OIDC Handover dataProvider: MojeID TestClaims: {…} (copy from the example below) For mojeid see list “claims_supported” in .well-known openid-configuration.Verified by names: … (copy from the example below)
How to run an example
Run the example in Docker. Install as follows:
$ git clone https://github.com/CZ-NIC/djangocms-oidc-form-fields.git
$ cd djangocms-oidc-form-fields/example
$ docker-compose build web
$ docker-compose run --user $(id -u):$(id -g) web python manage.py migrate
$ docker-compose run --user $(id -u):$(id -g) web python manage.py loaddata site.json
You start the webserver:
$ docker-compose up -d
Open in your browser: https://localhost:8000/. To log in to the administrations use admin:password at http://localhost:8000/admin.
You sto Webserver:
$ docker-compose down
License
This software is licensed under the GNU GPL license. For more info check the LICENSE file.
Metadata
Release files for djangocms-oidc-form-fields 4.1.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 | Actions |
|---|---|---|---|---|
| djangocms_oidc_form_fields-4.1.0.tar.gz | 27.6 kB | Without provenance | Details for djangocms_oidc_form_fields-4.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| djangocms_oidc_form_fields-4.1.0-py3-none-any.whl | Python 3 | none | any | Details for djangocms_oidc_form_fields-4.1.0-py3-none-any.whl |
Total release size: 59.6 kB
Release files / djangocms_oidc_form_fields-4.1.0.tar.gz
| Download URL | djangocms_oidc_form_fields-4.1.0.tar.gz |
|---|---|
| Size | 27.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
803d12adba7f3c5b02aad805cf957e6d7ddc17e7becb867bd318bd9c04fe79b2
|
|
BLAKE2b-256 checksum How to use checksums |
5ae248e2270ead0c71db211cf5cd4492aa449e0f573d81a13f4ae24187ecb2d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.3
|
Release files / djangocms_oidc_form_fields-4.1.0-py3-none-any.whl
| Download URL | djangocms_oidc_form_fields-4.1.0-py3-none-any.whl |
|---|---|
| Size | 32.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
05dd6c0314d6e80888425666d4394aabe075a1c3276d724147b3e28914eee6a6
|
|
BLAKE2b-256 checksum How to use checksums |
87667169118fa0e518d0e2affd3a2aae2a3ba2fd38e7e8ded3def2d6bcf28e95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.3
|
Security for djangocms-oidc-form-fields 4.1.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.