No project description provided
Project description
===== dnoticias_auth
dnoticias_auth is a Django app to make the authentication in the DNOTICIAS PLATFORMS.
Quick start
-
Add "dnoticias_auth" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = [ ... 'dnoticias_auth', ]
-
Include the polls URLconf in your project urls.py like this::
path('auth/', include('dnoticias_auth.urls')),
-
Run
python manage.py migrate
to create the dnoticias_auth models. -
Add the necessary settings variables
-
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
Hashes for django_dnoticias_auth-1.2.9rc0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b94ff4be5d6da3b1ee36d98f4fffe1b72fc702183af425e2261232081384e1b7 |
|
MD5 | 86fce1edbaed5e26c13737b873d346c1 |
|
BLAKE2b-256 | b83fd51b54c96636d7f7b1207db329d41e4caabe21e1f9fcc292e1e4749c3f50 |