Handle login and ticket validation for french GAR
Project description
django-gar
Handle CAS login for the french Gestionnaire d'Accès au Ressources (GAR).
Installation
Install with pip:
pip install django-gar
Setup
In order to make django-gar
works, you'll need to follow the steps below.
Settings
First you need to add the following configuration to your settings:
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.sessions',
'django.contrib.messages',
'django_gar',
...
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django_gar.middleware.GARMiddleware', # mandatory
...
)
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
'django_gar.backends.GARBackend',
...
)
Migrations
Next, you need to run the migrations in order to update your database schema.
python manage.py migrate
Mandatory settings
Here is the list of all the mandatory settings:
GAR_BASE_URL
GAR_BASE_SUBSCRIPTION_URL
GAR_SUBSCRIPTION_PREFIX
GAR_DISTRIBUTOR_ID
GAR_CERTIFICATE_PATH
GAR_KEY_PATH
GAR_RESOURCES_ID
GAR_ORGANIZATION_NAME
The optional settings with their default values:
GAR_ACTIVE_USER_REDIRECT (default: "/")
GAR_INACTIVE_USER_REDIRECT (default: "/")
GAR_QUERY_STRING_TRIGGER (default: "sso_id")
Tests
Testing is managed by pytest
. Required package for testing can be installed with:
pip install -r test_requirements.txt
To run testing locally:
pytest
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_gar-2.13.0.tar.gz
(28.0 kB
view hashes)
Built Distribution
Close
Hashes for django_gar-2.13.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28dbf8565af99411de82230cf56ba51cabe837b2c48925c0bca2807811d8766f |
|
MD5 | 7c96a158ae4bf2f7bdeba681445075ee |
|
BLAKE2b-256 | 03ed0ed952f2350f451caf12173ee2ff5d9a67fc23298a02f5904fd22951a1f7 |