diff options
| author | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-08-11 23:02:55 +0000 |
|---|---|---|
| committer | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-08-11 23:02:55 +0000 |
| commit | 2c3b5a50c5c1e6d84ccc74eb55b355af13fd8aa8 (patch) | |
| tree | 0ecaf6efca3920c6adde149b58ad53d64339132b /python/tests/LibertyEnabledProxy.py | |
| parent | 02677987a48a67d99f5aacd915119a658dacd42a (diff) | |
| download | lasso-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/LibertyEnabledProxy.py')
| -rw-r--r-- | python/tests/LibertyEnabledProxy.py | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/python/tests/LibertyEnabledProxy.py b/python/tests/LibertyEnabledProxy.py new file mode 100644 index 00000000..92582a33 --- /dev/null +++ b/python/tests/LibertyEnabledProxy.py @@ -0,0 +1,49 @@ +# -*- coding: UTF-8 -*- + + +# Lasso Simulator +# By: Emmanuel Raviart <eraviart@entrouvert.com> +# +# Copyright (C) 2004 Entr'ouvert +# http://lasso.entrouvert.org +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +import lasso + +from IdentityProvider import IdentityProviderMixin +from ServiceProvider import ServiceProviderMixin + + +class LibertyEnabledProxyMixin(IdentityProviderMixin, ServiceProviderMixin): + def __init__(self): + ServiceProviderMixin.__init__(self) + IdentityProviderMixin.__init__(self) + + def login(self, handler): + # Before, this proxy was considered as an identity provider. Now it is a service provider. + return ServiceProviderMixin.login(self, handler) + + def login_failed(self, handler): + # Before, this proxy was considered as a service provider. Now it acts again as a service + # provider. + return self.login_done(handler, False, None) + + def assertionConsumer_done(self, handler): + # Before, this proxy was considered as a service provider. Now it acts again as a service + # provider. + # FIXME: We should retrieve authentication method from session.lassoSessionDump. + return self.login_done(handler, True, lasso.samlAuthenticationMethodPassword) |
