Flip some debug messages to error messages in SAML2 provider
authorRob Crittenden <rcritten@redhat.com>
Fri, 4 Sep 2015 13:53:40 +0000 (09:53 -0400)
committerPatrick Uiterwijk <puiterwijk@redhat.com>
Fri, 4 Sep 2015 16:23:41 +0000 (18:23 +0200)
Some failures were only being logged at the debug level which
would be difficult if not impossible to track down on an
operational server. This should give an operator a chance to
figure out what is going on.

https://fedorahosted.org/ipsilon/ticket/159

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
ipsilon/providers/saml2idp.py

index 2e6f346..2b61fdf 100644 (file)
@@ -112,7 +112,7 @@ class Continue(AuthenticateRequest):
         self.debug('Continue auth for %s' % user.name)
 
         if 'saml2_request' not in transdata:
         self.debug('Continue auth for %s' % user.name)
 
         if 'saml2_request' not in transdata:
-            self.debug("Couldn't find Request dump?!")
+            self.error("Couldn't find Request dump in transaction?!")
             # TODO: Return to SP with auth failed error
             raise cherrypy.HTTPError(400)
         dump = transdata['saml2_request']
             # TODO: Return to SP with auth failed error
             raise cherrypy.HTTPError(400)
         dump = transdata['saml2_request']
@@ -120,10 +120,10 @@ class Continue(AuthenticateRequest):
         try:
             login = self.cfg.idp.get_login_handler(dump)
         except Exception, e:  # pylint: disable=broad-except
         try:
             login = self.cfg.idp.get_login_handler(dump)
         except Exception, e:  # pylint: disable=broad-except
-            self.debug('Failed to load status from dump: %r' % e)
+            self.error('Failed to load login status from dump: %r' % e)
 
         if not login:
 
         if not login:
-            self.debug("Empty Request dump?!")
+            self.error("Empty login Request dump?!")
             # TODO: Return to SP with auth failed error
             raise cherrypy.HTTPError(400)
 
             # TODO: Return to SP with auth failed error
             raise cherrypy.HTTPError(400)
 
@@ -365,7 +365,7 @@ Provides SAML 2.0 authentication infrastructure. """
             idp = IdentityProvider(self,
                                    sessionfactory=self.sessionfactory)
         except Exception, e:  # pylint: disable=broad-except
             idp = IdentityProvider(self,
                                    sessionfactory=self.sessionfactory)
         except Exception, e:  # pylint: disable=broad-except
-            self.debug('Failed to init SAML2 provider: %r' % e)
+            self.error('Failed to init SAML2 provider: %r' % e)
             return None
 
         self._root.logout.add_handler(self.name, self.idp_initiated_logout)
             return None
 
         self._root.logout.add_handler(self.name, self.idp_initiated_logout)
@@ -381,7 +381,7 @@ Provides SAML 2.0 authentication infrastructure. """
             try:
                 idp.add_provider(sp)
             except Exception, e:  # pylint: disable=broad-except
             try:
                 idp.add_provider(sp)
             except Exception, e:  # pylint: disable=broad-except
-                self.debug('Failed to add SP %s: %r' % (sp['name'], e))
+                self.error('Failed to add SP %s: %r' % (sp['name'], e))
 
         return idp
 
 
         return idp