Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
b673cfd8
Commit
b673cfd8
authored
Jun 01, 2011
by
Georgios Gousios
Browse files
Bypass authentication using a settings param
parent
88935da0
Changes
2
Hide whitespace changes
Inline
Side-by-side
aai/middleware.py
View file @
b673cfd8
...
...
@@ -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
...
...
settings.py.dist
View file @
b673cfd8
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment