Skip to main content

No project description provided

Project description

===== dnoticias_auth

dnoticias_auth is a Django app to make the authentication in the DNOTICIAS PLATFORMS.

Quick start

  1. Add "dnoticias_auth" to your INSTALLED_APPS setting like this::

    INSTALLED_APPS = [ ... 'dnoticias_auth', ]

  2. Include the polls URLconf in your project urls.py like this::

    path('auth/', include('dnoticias_auth.urls')),

  3. Run python manage.py migrate to create the dnoticias_auth models.

  4. Add the necessary settings variables

  5. Add the following middleware:

MIDDLEWARE = [
    ...
    'dnoticias_auth.middleware.LoginMiddleware',
    'mozilla_django_oidc.middleware.SessionRefresh',
    'dnoticias_auth.middleware.TokenMiddleware',
]

LoginMiddleware is a preprocessor that will see the cookies and simulate an OIDC login action, this needs to be before mozilla SessionRefresh.

TokenMiddleware is a posprocessor that will take the session variables (if the user is logged in) and put them into cookies. This is used in another clients on the LoginMiddleware

Settings variables

Setting Default value Description
OIDC_STORE_ACCESS_TOKEN True OIDC store access token in session (TRUE ONLY)
OIDC_STORE_ID_TOKEN True OIDC store id token in session (TRUE ONLY)
AUTH_COOKIE_EXPIRATION_MINUTES 15 Cookie expiration time
AUTH_COOKIE_DOMAIN dnoticias.pt Cookie domain
AUTH_COOKIE_SECURE True Secure cookie in HTTPS only
AUTH_COOKIE_HTTPONLY True Prevents changes from JS

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_dnoticias_auth-1.2.9.1.tar.gz (13.7 kB view details)

Uploaded Source

File details

Details for the file django_dnoticias_auth-1.2.9.1.tar.gz.

File metadata

  • Download URL: django_dnoticias_auth-1.2.9.1.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.5

File hashes

Hashes for django_dnoticias_auth-1.2.9.1.tar.gz
Algorithm Hash digest
SHA256 0cbf7d91289e23dd9de08c99bc6aa28dbaf79b5bf19a413de6a00937f4a2afb5
MD5 12310164258de301e98e1070cac4a333
BLAKE2b-256 20998da7db92ce9c54a01788d50432fd7d94c4eb220fcf0082b596e5a677b7e0

See more details on using hashes here.

Supported by

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