summaryrefslogtreecommitdiffstats
path: root/python/tests/web.py
diff options
context:
space:
mode:
authorEmmanuel Raviart <eraviart@entrouvert.com>2004-08-11 23:02:55 +0000
committerEmmanuel Raviart <eraviart@entrouvert.com>2004-08-11 23:02:55 +0000
commit2c3b5a50c5c1e6d84ccc74eb55b355af13fd8aa8 (patch)
tree0ecaf6efca3920c6adde149b58ad53d64339132b /python/tests/web.py
parent02677987a48a67d99f5aacd915119a658dacd42a (diff)
downloadlasso-2c3b5a50c5c1e6d84ccc74eb55b355af13fd8aa8.tar.gz
lasso-2c3b5a50c5c1e6d84ccc74eb55b355af13fd8aa8.tar.xz
lasso-2c3b5a50c5c1e6d84ccc74eb55b355af13fd8aa8.zip
Create a new test Proxy server (a server between a SP and an IDP, which acts
as an IDP for the SP and as a SP for the IDP): login works.
Diffstat (limited to 'python/tests/web.py')
-rw-r--r--python/tests/web.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/python/tests/web.py b/python/tests/web.py
index d2db8ed4..55011a28 100644
--- a/python/tests/web.py
+++ b/python/tests/web.py
@@ -114,7 +114,6 @@ class WebUser(abstractweb.WebUserMixin, object):
class WebSite(abstractweb.WebSiteMixin, WebClient):
- instantAuthentication = True # Authentication doesn't use a HTML form.
url = None # The main URL of web site
WebSession = WebSession
WebUser = WebUser
@@ -124,7 +123,12 @@ class WebSite(abstractweb.WebSiteMixin, WebClient):
abstractweb.WebSiteMixin.__init__(self)
self.url = url
- def authenticate(self, handler, callback, *arguments, **keywordArguments):
+ def authenticateLoginPasswordUser(self, login, password):
+ # We should check login & password and return the user if one matches or None otherwise.
+ # FIXME: Check password also.
+ return self.users.get(login)
+
+ def login_local(self, handler):
user = handler.user
if user is None:
failUnless(handler.useHttpAuthentication)
@@ -133,8 +137,8 @@ class WebSite(abstractweb.WebSiteMixin, WebClient):
# The user is already authenticated using HTTP authentication.
userAuthenticated = True
- import lasso
- authenticationMethod = lasso.samlAuthenticationMethodPassword # FIXME
+ # authenticationMethod = lasso.samlAuthenticationMethodPassword
+ authenticationMethod = 'urn:oasis:names:tc:SAML:1.0:am:password'
if userAuthenticated:
session = handler.session
if session is None:
@@ -147,10 +151,9 @@ class WebSite(abstractweb.WebSiteMixin, WebClient):
user = handler.createUser()
session.userId = user.uniqueId
user.sessionToken = session.token
- return callback(handler, userAuthenticated, authenticationMethod, *arguments,
- **keywordArguments)
+ return self.login_done(handler, userAuthenticated, authenticationMethod)
- def authenticateLoginPasswordUser(self, login, password):
- # We should check login & password and return the user if one matches or None otherwise.
- # FIXME: Check password also.
- return self.users.get(login)
+ def login_failed(self, handler):
+ if handler.useHttpAuthentication:
+ handler.useHttpAuthentication = 'not this time'
+ return handler.respond(401, 'Access Unauthorized: User has no account.')