diff options
author | Simo Sorce <simo@redhat.com> | 2014-10-10 13:34:00 -0400 |
---|---|---|
committer | Patrick Uiterwijk <puiterwijk@redhat.com> | 2014-10-24 18:03:28 +0200 |
commit | fe50fd3423969fca640cc35b32678bab5fd491cb (patch) | |
tree | f3f3c81553934cdf89d5578018b982744837301d /ipsilon/login/authkrb.py | |
parent | 66361edf21ca83ad9e34177436f32e792fd8b893 (diff) | |
download | ipsilon-fe50fd3423969fca640cc35b32678bab5fd491cb.tar.gz ipsilon-fe50fd3423969fca640cc35b32678bab5fd491cb.tar.xz ipsilon-fe50fd3423969fca640cc35b32678bab5fd491cb.zip |
Handle invalid/expired transactions gracefully
Return a useful error page every time and invalid or expired
transaction is requested, instead of ending up with an internal
backtrace and an ugly 500 error.
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Diffstat (limited to 'ipsilon/login/authkrb.py')
-rwxr-xr-x | ipsilon/login/authkrb.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ipsilon/login/authkrb.py b/ipsilon/login/authkrb.py index 965d018..724c2ce 100755 --- a/ipsilon/login/authkrb.py +++ b/ipsilon/login/authkrb.py @@ -20,7 +20,6 @@ from ipsilon.login.common import LoginPageBase, LoginManagerBase from ipsilon.login.common import FACILITY from ipsilon.util.plugin import PluginObject -from ipsilon.util.trans import Transaction from ipsilon.util.user import UserSession from string import Template import cherrypy @@ -38,7 +37,7 @@ class Krb(LoginPageBase): class KrbAuth(LoginPageBase): def root(self, *args, **kwargs): - trans = Transaction('login', **kwargs) + trans = self.get_valid_transaction('login', **kwargs) # If we can get here, we must be authenticated and remote_user # was set. Check the session has a user set already or error. us = UserSession() @@ -71,7 +70,8 @@ class KrbError(LoginPageBase): cont=conturl) # If we get here, negotiate failed - return self.lm.auth_failed(Transaction('login', **kwargs)) + trans = self.get_valid_transaction('login', **kwargs) + return self.lm.auth_failed(trans) class LoginManager(LoginManagerBase): |