diff --git a/clintools/settings.py b/clintools/settings.py index 8bf70b2..8ef6069 100644 --- a/clintools/settings.py +++ b/clintools/settings.py @@ -43,6 +43,7 @@ 'bootstrap3', 'bootstrap3_datetime', 'djangular', + 'shibboleth', ) MIDDLEWARE_CLASSES = ( @@ -54,8 +55,13 @@ 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', + 'shibboleth.middleware.ShibbolethRemoteUserMiddleware', ) +AUTHENTICATION_BACKENDS = [ + 'shibboleth.backends.ShibbolethRemoteUserBackend', +] + ROOT_URLCONF = 'clintools.urls' TEMPLATES = [ @@ -76,6 +82,16 @@ WSGI_APPLICATION = 'clintools.wsgi.application' +SHIBBOLETH_ATTRIBUTE_MAP = { + "wustlEduId": (True, "wustl-pk"), +# "cn": (False, "first_name"), + "givenName": (False, "first_name"), + "sn": (False, "last_name"), +# "mail": (False, "email"), +} + +LOGIN_URL = 'https://pttrack.snhc.wustl.edu/Shibboleth.sso/Login' + # Database # https://docs.djangoproject.com/en/1.8/ref/settings/#databases diff --git a/clintools/urls.py b/clintools/urls.py index 4014c92..ae957b7 100644 --- a/clintools/urls.py +++ b/clintools/urls.py @@ -8,6 +8,6 @@ # url(r'^blog/', include('blog.urls')), url(r'^pttrack/', include('pttrack.urls')), url(r'^admin/', include(admin.site.urls)), - url(r'^accounts/', include('django.contrib.auth.urls')), url(r'^$', RedirectView.as_view(pattern_name="home", permanent=False)), + url(r'^shib/', include('shibboleth.urls', namespace='shibboleth')), ] diff --git a/pttrack/templates/pttrack/base.html b/pttrack/templates/pttrack/base.html index 68d93a4..f5c42f1 100644 --- a/pttrack/templates/pttrack/base.html +++ b/pttrack/templates/pttrack/base.html @@ -40,7 +40,7 @@ {% if user.is_authenticated %}
@@ -63,4 +63,4 @@