Requiring Django session for REST API
Project: http://git-wip-us.apache.org/repos/asf/airavata-django-portal/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata-django-portal/commit/4147972a Tree: http://git-wip-us.apache.org/repos/asf/airavata-django-portal/tree/4147972a Diff: http://git-wip-us.apache.org/repos/asf/airavata-django-portal/diff/4147972a Branch: refs/heads/master Commit: 4147972a1c157f570abdc5baaa6f243154f4c586 Parents: e8e0fc4 Author: Marcus Christie <[email protected]> Authored: Tue Sep 19 14:06:34 2017 -0400 Committer: Marcus Christie <[email protected]> Committed: Tue Sep 19 14:06:34 2017 -0400 ---------------------------------------------------------------------- django_airavata/settings.py | 10 ++++++++++ 1 file changed, 10 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-django-portal/blob/4147972a/django_airavata/settings.py ---------------------------------------------------------------------- diff --git a/django_airavata/settings.py b/django_airavata/settings.py index c0b55d9..c803a33 100644 --- a/django_airavata/settings.py +++ b/django_airavata/settings.py @@ -129,6 +129,16 @@ USE_TZ = True STATIC_URL = '/static/' STATICFILES_DIRS = [os.path.join(BASE_DIR, "django_airavata", "static")] +# Django REST Framework configuration +REST_FRAMEWORK = { + 'DEFAULT_AUTHENTICATION_CLASSES': ( + 'rest_framework.authentication.SessionAuthentication', + ), + 'DEFAULT_PERMISSION_CLASSES': ( + 'rest_framework.permissions.IsAuthenticated', + ), +} + AUTHENTICATION_BACKENDS = [ 'django_airavata.apps.auth.backends.KeycloakBackend' ]
