Add 500 Error handler for krb module
authorSimo Sorce <simo@redhat.com>
Wed, 7 May 2014 13:51:25 +0000 (09:51 -0400)
committerSimo Sorce <simo@redhat.com>
Wed, 7 May 2014 14:00:35 +0000 (10:00 -0400)
If mod_auth_kerb encounters an internal error, catch it so we can fall back to
the next authentication module, if any, or return a proper failure message.

Signed-off-by: Simo Sorce <simo@redhat.com>
ipsilon/login/authkrb.py

index c67b93b..7132913 100755 (executable)
@@ -82,6 +82,7 @@ plugin for actual authentication. """
         self.page = Krb(site, self)
         self.page.__dict__['negotiate'] = KrbAuth(site, self)
         self.page.__dict__['unauthorized'] = KrbError(site, self)
         self.page = Krb(site, self)
         self.page.__dict__['negotiate'] = KrbAuth(site, self)
         self.page.__dict__['unauthorized'] = KrbError(site, self)
+        self.page.__dict__['failed'] = KrbError(site, self)
         return self.page
 
 
         return self.page
 
 
@@ -101,6 +102,7 @@ CONF_TEMPLATE = """
   Require valid-user
 
   ErrorDocument 401 /${instance}/login/krb/unauthorized
   Require valid-user
 
   ErrorDocument 401 /${instance}/login/krb/unauthorized
+  ErrorDocument 500 /${instance}/login/krb/failed
 </Location>
 """
 
 </Location>
 """