Skip to main content

Plugin OIDC (OpenID Connect) for Aldryn form fields.

Project description

Build Status Coverage Pypi package status Python versions license

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 Test

Home › Djangocms_Oidc › Oidc providers › oidc provider: add

Name: MojeID Test
Code: mojeid
Register consumer: MojeID Test

Page structure: Add

OpenID Connect: OIDC Handover data
Provider: MojeID Test
Claims: {…} (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.

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

djangocms_oidc_form_fields-3.0.1.tar.gz (29.8 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file djangocms_oidc_form_fields-3.0.1.tar.gz.

File metadata

File hashes

Hashes for djangocms_oidc_form_fields-3.0.1.tar.gz
Algorithm Hash digest
SHA256 0b3e1a178569965a100ecc673f62b6fe0495c29ea99b250fbe2b15aba4103f81
MD5 c76c406a393afa7e1047493e1689653d
BLAKE2b-256 bbe4d63ead753d091df207f51f5453a457d46b08db704e30cdfbf47119d4bce5

See more details on using hashes here.

File details

Details for the file djangocms_oidc_form_fields-3.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for djangocms_oidc_form_fields-3.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e4391a665b101f17ecc2b7e81a62650e4f387d0a5dea9ae83f005986bc414c76
MD5 576bfb0b13dc69f446b93ca9e0a69283
BLAKE2b-256 5124dbd473b921412811b1b8edcb26a9daf76d0d8b7449e9e7ecb890bb537507

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page