better error message when authn servlets are accessed directly
[java-idp.git] / src / edu / internet2 / middleware / shibboleth / idp / authn / provider / RemoteUserAuthServlet.java
index 700bd0d..067e2e3 100644 (file)
@@ -49,6 +49,13 @@ public class RemoteUserAuthServlet extends HttpServlet {
                             + " returning control back to authentication engine");
         }
         httpRequest.setAttribute(LoginHandler.PRINCIPAL_NAME_KEY, httpRequest.getRemoteUser());
                             + " returning control back to authentication engine");
         }
         httpRequest.setAttribute(LoginHandler.PRINCIPAL_NAME_KEY, httpRequest.getRemoteUser());
-        AuthenticationEngine.returnToAuthenticationEngine(httpRequest, httpResponse);
+
+        try {
+            AuthenticationEngine.returnToAuthenticationEngine(httpRequest, httpResponse);
+        } catch (ServletException e) {
+            throw new ServletException("Unable to return to authentication engine.  "
+                    + "Authentication servlet should not be accessed directly.");
+        }
+
     }
 }
\ No newline at end of file
     }
 }
\ No newline at end of file