Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion shibboleth/app_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
#At a minimum you will need username,
default_shib_attributes = {
"REMOTE_USER": (True, "username"),
}
}
default_shib_username_attribute = 'REMOTE_USER'

SHIB_ATTRIBUTE_MAP = getattr(settings, 'SHIBBOLETH_ATTRIBUTE_MAP', default_shib_attributes)
SHIB_USERNAME_ATTRIBUTE = getattr(settings, 'SHIBBOLETH_USERNAME_ATTRIBUTE', default_shib_username_attribute)
#Set to true if you are testing and want to insert sample headers.
SHIB_MOCK_HEADERS = getattr(settings, 'SHIBBOLETH_MOCK_HEADERS', False)

Expand Down
3 changes: 2 additions & 1 deletion shibboleth/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
from django.core.exceptions import ImproperlyConfigured
import re

from shibboleth.app_settings import SHIB_ATTRIBUTE_MAP, GROUP_ATTRIBUTES, GROUP_DELIMITERS
from shibboleth.app_settings import SHIB_ATTRIBUTE_MAP, SHIB_USERNAME_ATTRIBUTE, GROUP_ATTRIBUTES, GROUP_DELIMITERS


class ShibbolethRemoteUserMiddleware(RemoteUserMiddleware):
header = SHIB_USERNAME_ATTRIBUTE
"""
Authentication Middleware for use with Shibboleth. Uses the recommended pattern
for remote authentication from: http://code.djangoproject.com/svn/django/tags/releases/1.3/django/contrib/auth/middleware.py
Expand Down