summaryrefslogtreecommitdiff
path: root/wsgitools/middlewares.py
diff options
context:
space:
mode:
Diffstat (limited to 'wsgitools/middlewares.py')
-rw-r--r--wsgitools/middlewares.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/wsgitools/middlewares.py b/wsgitools/middlewares.py
index 13ba41c..b385e91 100644
--- a/wsgitools/middlewares.py
+++ b/wsgitools/middlewares.py
@@ -337,9 +337,9 @@ class BasicAuthMiddleware(AuthenticationMiddleware):
self.realm = realm
self.app401 = app401
- def authenticate(self, auth, environ, start_response):
- """wsgi interface
- @type environ: {str: str}
+ def authenticate(self, auth, environ):
+ """
+ @type environ: {str: object}
"""
assert isinstance(environ, dict)
try:
@@ -355,8 +355,7 @@ class BasicAuthMiddleware(AuthenticationMiddleware):
except TypeError: # catch old interface
result = self.check_function(username, password)
if result:
- environ["REMOTE_USER"] = username
- return self.app(environ, start_response)
+ return dict(user=username)
raise AuthenticationRequired("credentials not valid")
def www_authenticate(self, exception):