Commit b673cfd8 authored by Georgios Gousios's avatar Georgios Gousios
Browse files

Bypass authentication using a settings param

parent 88935da0
......@@ -19,9 +19,10 @@ class SynnefoAuthMiddleware(object):
# Special case for testing purposes, delivers the cookie for the
# test user on first access
# TODO: REMOVE THE FOLLOWING BEFORE DEPLOYMENT
if request.GET.get('test') is not None:
u = SynnefoUser.objects.get(auth_token='46e427d657b20defe352804f0eb6f8a2')
if settings.BYPASS_AUTHENTICATION and \
request.GET.get('test') is not None:
u = SynnefoUser.objects.get(
auth_token='46e427d657b20defe352804f0eb6f8a2')
return self._redirect_shib_auth_user(user = u)
token = None
......
......@@ -260,3 +260,8 @@ SMTP_SERVER="127.0.0.1"
#Email account to use for system emails
SYSTEM_EMAIL_ADDR="noreply@grnet.gr"
#Enable receiving a temporary auth token (using the ?test URL parameter) that
#bypasses the authentication mechanism
#WARNING, ACHTUNG, README, XXX ,etc: DO NOT ENABLE THIS ON DEPLOYED VERSIONS
BYPASS_AUTHENTICATION = False
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment