Fix some TODOs
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 29 Mar 2011 20:10:48 +0000 (20:10 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 29 Mar 2011 20:10:48 +0000 (20:10 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1086709 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/authenticator/LocalStrings.properties
java/org/apache/catalina/authenticator/SpnegoAuthenticator.java

index b1ed7e6..b94207a 100644 (file)
@@ -29,3 +29,7 @@ authenticator.userDataConstraint=This request violates a User Data constraint fo
 
 formAuthenticator.forwardErrorFail=Unexpected error forwarding to error page
 formAuthenticator.forwardLoginFail=Unexpected error forwarding to login page
+
+spnegoAuthenticator.hostnameFail=Unable to determine the host name to construct the default SPN. Please set the spn attribute of the authenticator.
+spnegoAuthenticator.serviceLoginFail=Unable to login as the service principal
+spnegoAuthenticator.ticketValidateFail=Failed to validate client supplied ticket
\ No newline at end of file
index 6a3013a..d4dff6e 100644 (file)
@@ -138,8 +138,8 @@ public class SpnegoAuthenticator extends AuthenticatorBase {
             try {
                 name.append(InetAddress.getLocalHost().getCanonicalHostName());
             } catch (UnknownHostException e) {
-                // TODO add a message
-                throw new LifecycleException(e);
+                throw new LifecycleException(
+                        sm.getString("spnegoAuthenticator.hostnameFail"), e);
             }
             serviceProvideName = name.toString();
         } else {
@@ -154,8 +154,8 @@ public class SpnegoAuthenticator extends AuthenticatorBase {
             lc.login();
             serviceSubject = lc.getSubject();
         } catch (LoginException e) {
-            // TODO add a message
-            throw new LifecycleException(e);
+            throw new LifecycleException(
+                    sm.getString("spnegoAuthenticator.serviceLoginFail"), e);
         }
     }
 
@@ -211,8 +211,10 @@ public class SpnegoAuthenticator extends AuthenticatorBase {
                             new KerberosAuthAction(decoded.getBytes(),
                                     response, context));
                 } catch (PrivilegedActionException e) {
-                    // TODO Auto-generated catch block
-                    e.printStackTrace();
+                    if (log.isDebugEnabled()) {
+                        log.debug(sm.getString(
+                                "spnegoAuthenticator.ticketValidateFail"));
+                    }
                 }
                 
                 if (principal != null) {